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

[Output error] Team change on death?

Asked by 4 years ago
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!

0
<eof> is the end of file, meaning that your script terminated too early. If it says the phrase "got <eof>," 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. Fifkee 2017 — 4y

1 answer

Log in to vote
2
Answered by
Rynappel 212 Moderation Voter
4 years ago

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

Answer this question