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

How To Award Points To Player Who Killed?

I know you have to do something like check if the damage thing kills the player but I don't get it can someone please give me example script that will help thank you

so on the part where it says

hum:TakeDamage(Damage)

i put

if hum.Health - Damage <= 0 then

hum:TakeDamage(Damage)

game.Players.LocalPlayer.leaderstats.Points.Value =

game.Players.LocalPlayer.leaderstats.Points.Value + 100

end

pls tell me for some reason it not work can you tell me how the right way is

2 comments

0

create a creatortag and if the humanoid.Health == 0 then it finds the value of the creatortag (a player name) and awards that player

0

swords use creatortags

2 answers

game.Players.PlayerAdded:Connect(function(char)
	stats = Instance.new("IntValue")
	stats.Name = "leaderstats"
	stats.Parent = char
	d = Instance.new("IntValue")
	d.Name = "Deaths"
	d.Parent = stats
	d.Value = 0
end)
while wait() do
	for _,p in pairs(game.Players:GetPlayers()) do
		if p.Character.Humanoid.Health == 0 then
			local ls = p:FindFirstChild("leaderstats")
			local dth = ls:FindFirstChild("Deaths")
			dth.Value = dth.Value + 1
		end
	end
end

2 comments

0

This script detects only if a Player dies and does not kill.

0

no what i mean is if a person kills someone give him money i dont want a leaderboard i already have one

OMG GUYS I FIXED IT ALL I NEEDED TO DO WAS MAKE IT TO A LOCAL SCRIPT thanks

i think i had same problem always with me lol

1 comment

0

lol

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