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

How do I make punching damage increase according to leaderstats?

This is the damage script inside of the punch.

script.Parent.Touched:Connect(function(hit)
	local char = hit.Parent
	local hum = char:FindFirstChild("Humanoid")
	if hum and char.Name ~= script.Parent.Parent.Name then
		hum.Health = hum.Health - 10
		script.Disabled = true
		wait(1.4)
		script.Disabled = false
	end
end)

3 comments

0

Leaderstats name is "Pounds"

0

Try the new one.

0

Thank you so much!

1 answer

✓ Accepted answer

Use this script:

script.Parent.Touched:Connect(function(hit)
    local char = hit.Parent
    local hum = char:FindFirstChild("Humanoid")


    if hum and char.Name ~= script.Parent.Parent.Name then
local m = math.random(1,30)
        hum.Health = hum.Health - m
        script.Disabled = true
        wait(1.4)
        script.Disabled = false
    end
end)

4 comments

0

It is not working, any way to fix it.?

0

Wait, Is there any way i can make it do random damage? like 1 through 30 damage

0

Yes, let me fix that.

0

-1. No explanation was given.

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