• How to use ents.FindInBox() appropriately?
    11 replies, posted
Okay, if i want to find a particular entity within a range of 20 from the entity's middle and out, how would i do this? And if i find it will activate a function.
[lua]for _, v in pairs( ents.FindInSphere( self:GetPos(), 20 ) ) do if( v:GetClass() == "class or whatever" ) then v:Func(); end end[/lua]
Thank you Engineer! ^^ [editline]9th April 2011[/editline] New question, can i use if v:GetName() == "The entity i want to find" then for entities ? [editline]9th April 2011[/editline] :siren: Bump bump. :siren: Please don't ban med for bumping it so fast, but i need help now.
Trolololol auto-merge. And no you can't.
So there's no funtion like Entity.GetPrintName()? Damn.
Sadly not.
I have checked whole the entity library and i can only find the GetName()
You could use [b]SetName("My Entity")[/b] Then simply return this [b]local name = GetName()[/b]
I don't get it why cant you use GetClass()?
Yeah, he's right. I didn't really read the thread. The reason why I would use SetName and GetName would be for chatprints and menus etc. You should just use GetClass()
But what if i did that wouldn't then also be effected by itself or other entitys
It has been fixed thank you engineers!
Sorry, you need to Log In to post a reply to this thread.