Im in uncharted territory... Anyone know how?
In the script which is in the game workspace has a global table
1 | tablee = { "Player1" } |
Im trying to access it from a local script inside the players Backpack with:
1 | for i, v in pairs (tablee) do |
2 | if v = = player.Name then |
3 | table.remove(tablee, i) |
4 | print (table.concat(tablee, ", " )) |
5 | end |
6 | end |
And i get an error saying:
Players.Player1.Backpack.TouchedEvent:35: bad argument #1 to 'pairs' (table expected, got nil)
To make things Global, instead of adding local before the variable/function/ect, add a "_G."
1 | _G.tablee = { } |