Ad
Log in to vote
0

How to use player died???

Asked by 5 months ago
Edited by Goulstem 5 months 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 — 5mo
0
end) GameBoyOtaku 3 — 5mo

1 answer

Log in to vote
0
Answered by
welt101 12
5 months 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



Ad