Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

3 comments

0

Is the damage to kill the player being done on the client? Is the above code in a server script?

0

I've also try RemoteEvent to but nothing did'nt work at all! :(

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

1 answer

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")

This discussion is preserved as it was. New answers, comments, and votes are closed.