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

How to use player died???

Asked by
Galicate 106
6 years ago
Edited by Goulstem 6 years ago

Tryina make a script that when a player on red team dies, the blue team gets a point.


game.Players.PlayerAdded:connect(function(p)
if p.TeamColor == BrickColor.new("Really red") and p.Humanoid.Died() then
    script.Parent.Blueteam.Text = script.Parent.Blueteam.Text + 1
end

but this doesnt work, i dont know how to do this.

Edited 19:55 11/13/17 ~ Format your code correctly!
0
You're missing an end Viking359 161 — 6y
0
end) GameBoyOtaku 63 — 6y

1 answer

Log in to vote
0
Answered by
welt101 12
6 years ago

Something like that

game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function()
            if player.TeamColor == BrickColor.new("Really red") then
                --do something              
            end
        end)
    end)
end)
Ad

Answer this question