Ad
Log in to vote
0

How do you remove something from a table??

Asked by 11 days ago
Payers = game:GetService("Players")

Outgame = {}

table.remove(Outgame,Payers.Name)

1 answer

Log in to vote
0
Answered by
LawlR 141
11 days 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