Hey guys,
so I've FINALLY decided to put a bit more effort into learning LUA Tables, considering I've been ignoring it for the last few months, and I'm beginning to wonder if it's possible to select a certain string from your table, without knowing the index location.
In this example I've created a table that adds your username once you join, and should remove your name when you leave.
admins = {}
game.Players.PlayerAdded:Connect(function(plr)
table.insert(admins, plr.Name)
print("Inserted user "..plr.Name)
end)
game.Players.PlayerRemoving:Connect(function(plr)
table.remove(admins, plr.Name)
print("Removed user "..plr.Name)
end)
The joining part works great, yet, obviously, when the user leaves, the table can't select plr.Name because it's not an index value (1,2,3, etc).
Is there any way to work around this issue? PS: This is a SCRIPT, not a LocalScript, trying to expand this to a custom leaderboard in the near future
Thanks!

1 comment
No, you can't remove anithing from a table without using the index