All pastes #583869 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-22 15:13 UTC
rendered paste body
function DrinkAlcohol(ply,code)
	if( code ~= IN_USE ) then return; end
	
	local tr = ply:GetEyeTrace();
	if( tr.Entity:IsValid() and tr.Entity:GetPos():Distance( ply:GetPos() ) < 90 ) then
		local mdl = tr.Entity:GetModel()
		
		if (not mdl == "models\props_junk\garbage_glassbottle001a.mdl" or not mdl == "models\props_junk\glassjug01.mdl" or not mdl == "models\props_junk\glassbottle01a.mdl" or not mdl == "models\props_junk\garbage_glassbottle003a.mdl") then return end 
		print("Made some alcohol")
		local amt = math.random(5-15)
		print("It has " .. amt .. " alchol value" )
		ply:UpdateAlcohol(amt)
		tr.Entity:Remove();
	end
end
hook.Add( "KeyPress", "DrinkAlcohol", DrinkAlcohol );