So i'm trying to make a script that detects when a player enters & leaves by putting their name in a table. Problem is i'm not sure if you can use table.remove() to remove a value,
local players = {}
game.Players.ChildAdded:connect(function(plr)
table.insert(players, ""..plr.Name)
end)
game.Players.ChildRemoved:Connect(function(plr)
table.remove(players, ""..plr.Name)
end)
Any tips on how I can get it to remove the child's name off of the table when they leave?

1 comment
Use PlayerAdded in the future.