function load_desert() local alive = {} for i,k in pairs(Players) do table.insert(alive,k.Name) print("added") end local squares = workspace.desert.Model.squares:GetChildren() for i,k in pairs(squares) do --ignore this k.Touched:Connect(function() k.Transparency = 0.5 wait(1) k.Transparency = 1 k.CanCollide = false wait(2.5) k.Transparency = 0.7 wait(3) k.CanCollide = true k.Transparency = 0 end) end game:GetService("Players").PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() for i,k in pairs(alive) do if k.Name == player.Name then table.remove(alive, i) print("died") end end end) end) end) end load_desert()
This code is supposed to add the players to a list and then if a player dies, he's removed from the list. But the messages added and died aren't printed.
Any suggestions?