Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you remove something from a table??

Asked by
danglt 185
5 years ago
Payers = game:GetService("Players")

Outgame = {}

table.remove(Outgame,Payers.Name)

1 answer

Log in to vote
0
Answered by
LawlR 182
5 years ago

Here's an example of how to do it:

ValueToRemove = "Player3"
Table = {"Player1", "Player2", "Player3"}
for i = 1, #Table do -- Iterates through the table
    if Table[i] == ValueToRemove then -- If the value it's currently on is the same as the value you are attempting to remove then...
        table.remove(Table[i]) -- The value gets removed
    end
end
Ad

Answer this question