• Calling Remove on a Table a nil value?
    3 replies, posted
Im trying to remove all entities with this class names but it returns it a nil value. [lua] function ResetSpawn(ply, cmd, args) for k, v in pairs(SpawnZone) do ents.FindByClass((v.Class)):Remove(); end timer.Destroy("SpawnZoneThink") end concommand.Add("reset_spawnpoints", ResetSpawn); [/lua] Any idea why Remove() would return nil if it's supposed to remove entities?
There aren't any entities. Also, it returne a table.
[QUOTE=Chessnut;35298231]There aren't any entities. Also, it returne a table.[/QUOTE] How would I go about removing it then?
[lua] for k2, v2 in pairs( ents.FindByClass(v.Class) ) do SafeRemoveEntity(v2); end; [/lua]
Sorry, you need to Log In to post a reply to this thread.