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

How can I add damage to a tool using the player's leaderstats?

i'm not sure how to add it into the script. (not a local script)

i tried using local damage = game:GetService("Players").LocalPlayer.leaderstats.Damage.Value but it doesn't wotk

Tool.Activated:Connect(function(p) if p.Parent:FindFirstChild("Humanoid") and p.Parent ~= Tool.Parent then if Debounce == false then Debounce = true print(dmg) wait(0.01) local Humanoid = Tool.Parent:WaitForChild("Humanoid") local AnimTrack = Humanoid:LoadAnimation(Slash)

		AnimTrack:Play()
		wait(.3)
		sound:Play()
		wait(0.4)
		Debounce = false
	end
end

end)

1 answer

✓ Accepted answer
Tool.Activated:Connect(function()
damage=game.Players[Tool.Parent.Name].leaderstats.Damage.Value
end)

1 comment

0

it doesn't work. when i removed the sword base damage and left to sword damage only to game.Players[Tool.Parent.Name].leaderstats.Damage.Value it says that the damage is 0 when its printed

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