I cannot figure out how to make ENT:Touch only detect when touching a specific entity instead of detecting anything and everything touching it. It probably has something to do with the argument but nothing I’ve tried has worked
current code (useless)
function ENT:Touch(entity)
EmitSound( Sound ("buttons/lightswitch2.wav" ), self:GetPos(), 1, CHAN_AUTO, 1, 75, 0, 100)
self:Remove()
end
I’ve tried making the argument the entity name, Using getclass in an if statement (to see if I can do if getclass comes back as the entity run the code) but neither of these or any variations of them have worked.
Pacman09 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.