Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

The Damage is not working on this tool and I dont know what is causing it. What is wrong?

Asked by
corbenv 17
5 years ago

So I made this tool called "Pipe" and it has animations that work properly but the damage on the pipe does not work. Ignore the part that's not about damage.

Here is the first set of code: script.Parent.PipeHit.Touched:connect(function() if script.Parent.CanDamage.Value == true then script.Parent.CanDamage.Value = false script.Parent.Humanoid:TakeDamage(15) wait(1.75) script.Parent.CanDamage.Value = true

end

end)

I have a value called "CanDamage".

Next script:

local CanAttack = true

script.Parent.Equipped:connect(function()

local PipePullOut = script.Parent.Parent.Humanoid:LoadAnimation(script.PipePullOut)

local PipeAttack = script.Parent.Parent.Humanoid:LoadAnimation(script.PipeAttack)

PipePullOut:Play()

script.Parent.Unequipped:connect(function(mouse)

PipePullOut:Stop()

end)

end)

script.Parent.Activated:connect(function()

local PipePullOut = script.Parent.Parent.Humanoid:LoadAnimation(script.PipePullOut)

local PipeAttack = script.Parent.Parent.Humanoid:LoadAnimation(script.PipeAttack)

if CanAttack == true then

PipeAttack:Play()

PipePullOut:Stop()

CanAttack = false

wait(0.65)

PipeAttack:Stop()

CanAttack = true

script.Parent.CanDamage.Value = true

end

end)

PipeAttack and PipePullOut are both Animations. Yes, I have a working Handle, and Yes, I have a part that serves as a hitbox to the pipe. Please Help!

0
also idk how to write it as code on this site like you guys do corbenv 17 — 5y
0
I'm sorry but which lines are supposed to damage players or start a chain of events leading to the same? Ankur_007 290 — 5y
0
The entire fist script and lines 13 - 22 of the second. corbenv 17 — 5y

Answer this question