Ad
Log in to vote
0

How to use player died???

Asked by 4 days ago
Edited by Goulstem 4 days 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 155 — 3d
0
end) GameBoyOtaku 2 — 3d

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

1 answer

Log in to vote
0
Answered by 2 days 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