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

Why isn't this died event part oof a leaderboard script working??

game.Players.Character.Humanoid.Died:connect(
	function(hit)
                  hit = Humanoid:FindFirstChild("")
		 hit.Name.Points.Value = hit.Name.Points.Value - 1
	end
)

1 answer

✓ Accepted answer

You misused the Died event. Also, you didn't properly access a Player's leaderstats which is a direct descendant of the Player. The script below was pulled straight from the Wiki. Any questions? Drop a comment below!

game:GetService('Players').PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Humanoid").Died:connect(function()
			player.leaderstats.Points.Value = player.leaderstats.Points.Value - 1
		end)
	end)
end)

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