I am trying to make a system when the player is X distance away from an entity it disapears and a sprite replaces it.
this is what i have so far:
function ENT:Think( ply )
self.Entity:SetNoDraw( true )
hook.Add( “HUDPaint”, “paintsprites”, function()
sprite1=Material( “sprite1” )
Vector1 = self.Entity:GetPos()
Vector1.z = Vector1.z+75
render.SetMaterial( sprite1 )
render.DrawSprite( Vector1, 128, 128, Color(255, 255, 255, 255) )
I am having 2 problems with this script.
- I do not know how to set up Vector:Distance for an entity, so that i can make it appear and disappear properly.
- when i have more then one entity only the new one has the sprite on it.
anything would help me right now i have been trying to figure out a way to get it to work all day.