I’ve asked around and nobody seems to understand how to help me.
I have an entity that is supposed to give you health when you use it, if you are below 200 hp. My problem is that when I am over 200 hp and i use the entity, it just deleted the physics and model.
function ENT:Use( ply ) if ( ply:IsPlayer() ) then if( ply:Health() < 200 ) then sound.Play( "vo/npc/male01/moan0".. math.random(1,5) ..".wav", self:GetPos( ) ) ply:SetHealth( ply:Health() + math.random(10,25)) self:Remove() end end end
Help is appreciated, thanks.
[editline]23rd May 2014[/editline]
Posted the wrong code, I updated it. Sorry!