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

How do I give the player who killed 10points?

I have leaderboard and I want to give the killer some points for killing someone.

leaderboard = game.Players.LocalPlayer.leaderstats

points = leaderboard.points

so what do i do now

2 comments

0

Already wrong, localplayer cannot be accessed from the server

0

oof

1 answer

I'll give you the nice side of me and say that you did try.

Tag the player on hit.

Then, when a player dies, connect to a humanoid.Died signal to give the player points.

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		local humanoid;
		repeat wait()
			humanoid = character:FindFirstChildOfClass('Humanoid')
		until humanoid
		humanoid.Died:connect(function(died)
			local playerwhoKilled = character:FindFirstChild('TaggedByPerson', true)
			game.Players[playerwhoKilled.Value].leaderstats.Points.Value = game.Players[playerwhoKilled.Value].leaderstats.Points.Value+10
		end)
	end)
end)

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