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

How to use player died???

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!

2 comments

0

You're missing an end

0

end)

1 answer

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)

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