• Cycling Ents?
    2 replies, posted
I was wondering, because I'm not sure if doing if(Ent is yes) will do it for all ents who are in the world or whatever will receive the action, or if just the ents who meet the criteria do it. But what I'm trying to do is that I want to make it so all ents in the world meeting a condition will do something, or in a specific range. Can anyone help clarify?
[lua]for k, v in ipairs(ents.GetAll()) do if v:GetClass() == "npc_zombie" then v:Ignite() end end[/lua] [b][url=wiki.garrysmod.com/?title=ents.GetAll]ents.GetAll [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] [b][url=wiki.garrysmod.com/?title=Using the For In Loop]Using the for in loop [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] :eng101:
Thank you! That's very nice of you. :)
Sorry, you need to Log In to post a reply to this thread.