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

[Output error] Team change on death?

player = game.Players.LocalPlayer

game:GetService('Players').PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		character:WaitForChild("Humanoid").Died:Connect(function()
		
         if player.TeamColor.BrickColor.Name == ("Dark blue") then
	player.TeamColor.BrickColor.Name = ("Really red")
else
	player.TeamColor.BrickColor.Name = ("Dark blue")
end

That is the code.

This is the error.

 Workspace.Team change when die.:13: Expected 'end' (to close 'function' at line 3), got <eof>

Im not sure how to deal with errors. Please help , thanks!

1 comment

0

is the end of file, meaning that your script terminated too early. If it says the phrase "got ," then it was probably expecting something like an "end" or some other identifier. Remember, if you should indent a group of lines, there should probably be an end accompanying it.

1 answer

✓ Accepted answer

You forgot to end the other functions,

player = game.Players.LocalPlayer

game:GetService('Players').PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        character:WaitForChild("Humanoid").Died:Connect(function()

         if player.TeamColor.BrickColor.Name == ("Dark blue") then
    player.TeamColor.BrickColor.Name = ("Really red")
else
    player.TeamColor.BrickColor.Name = ("Dark blue")
end
end)
end)

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