|
| 09 Aug 2012 04:45 AM |
I know you can use tables to add an item,
table.insert(TableName,Whattoinsert)
But, does anyone know if there is a way to remove something from a table? |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 04:47 AM |
table.remove(table,positionintable)
like so
table = {"Cool","Dah","Test"}
table.remove(table,2) print(table[2]) >Test |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 04:52 AM |
Workspace.Script.5:attempt to call field 'remove' (a nil value)
Should there be a function with it or something? |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 04:53 AM |
| Posting the script would be nice |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 09 Aug 2012 04:56 AM |
| it was your script stupid, you overwrote 'table' |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 04:57 AM |
function FindTarget()
local Target = false
while wait(5) do if game.Players.NumPlayers ~= 0 and Target == false then Target = true for i,v in pairs(game.Players:getChildren()[math.random(1, game.Players)]) do table.insert(Target,v) if v.Character.Humanoid.Health == 0 then Target = false end end end end
end
It's in beta so don't judge me :P |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 09 Aug 2012 04:58 AM |
| lol it's late give me a break |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 05:00 AM |
So essentially su8 was right - you can't have name variables table apparently.
Try renaming the table to something else |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Aug 2012 05:02 AM |
| It worked! Thanks for all the help you guys! :D |
|
|
| Report Abuse |
|
|