• Help with ents.GetAll()
    2 replies, posted
Im making a script that should make it possible to own doors. On startup the script is checking for all doors on the map, but it wont work... [PHP]Doors = {} function CheckForDoors() for k, v in pairs(ents.GetAll()) do if string.find(v:GetClass(),"door") then DoorID = v:EntIndex() local Door = {id = DoorID, owner = "none" } table.insert(Doors, Door) print(DoorID) end end end[/PHP] Help please
Place your code in a [b][url=wiki.garrysmod.com/?title=Gamemode.InitPostEntity]Gamemode.InitPostEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] hook. Your code ran before there were any doors on the map.
oh thanks
Sorry, you need to Log In to post a reply to this thread.