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

The script w'ont change the player team when he die ???

Asked by 5 years ago
Edited 5 years ago

In the output there always no error when the player die but it not changing team

 game.Players.PlayerAdded:connect(function(plr)
        plr.CharacterAdded:connect(function(char)
            char:WaitForChild("Humanoid").Died:Connect(function()
                plr.Team = game:GetService("Teams"):WaitForChild("Lobby")
            end)
        end)
    end)
0
Is the damage to kill the player being done on the client? Is the above code in a server script? SerpentineKing 3885 — 5y
0
I've also try RemoteEvent to but nothing did'nt work at all! :( LinkeeReiss 10 — 5y
0
This should be a server script. I cannot see anything wrong with this code make sure that the team exists or you will get an inf yield warning with WaitForChild User#5423 17 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Make sure the team is sure you already have a team that recommends you use :FindFirstChild() to be more direct.

plr.Team = game.Teams:FindFirstChild ("Lobby")

Ad

Answer this question