local deb = true
script.Parent.Enabled = true
script.Parent.Blade.Touched:connect(function(hit)
if not script.Parent.Enabled then
return
end
script.Parent.Enabled = false
if equipped and humanoid and humanoid.Health >=0 and deb == true then
deb = false
print(hit.Parent.Name)
target = hit.Parent:FindFirstChild'Humanoid'
if target and target.Health >= 0 then
print(hit.Parent.Name)
target:TakeDamage(damage.Value)
end
wait(.8)
script.Parent.Enabled = true
deb = true
end
end)
COMMUNITY QUESTION
how do i prevent a touched event from firing unless it is activated?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
when ever i go up to a dummy, the touched event fires, i want the touch event to fire when it is activated
What do you mean 'when it is activated'? A touched event is activated when you touch something
i have another script which swings the sword, i want this script to run when the sword swing script runs and stop when the sword swing script stops