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

Removing something from the table doesnt work?

Asked by 4 years ago
playerService.PlayerAdded:Connect(function(player)
    local randomBase = math.random(1,#bases)
    local findBase = "Base"..randomBase
    local baseInFolder = workspace.Bases[findBase]
    baseInFolder.Owner.Value = player.Name
    table.remove(bases, randomBase)
end)

for i,v in pairs(bases) do
    print(v)
end

It's not removing the base that the player gets. Help please.

0
Try doing the for loop inside the PlayerAdded. The for loop is most likely playing before base is removed from the list sheepposu 561 — 4y

Answer this question