I made a sword-skill script. Where when you press a keybind, it will runs a skill. But theres a trouble.
So I want it that the skill I made wont deal damage when the skill already runs. The problem is when the skill animation is over, the tool handle still deals damage. I want it so that it doesnt deal damage when you don’t use the skill anymore.
I looked for similar topic but couldn’t find the perfect solution. I was also just learnt some scripts like this.
This is the script that I wrote.
Handle.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= plr.Name then
local VCharacter = game.Workspace:FindFirstChild(plr.Name)
local vPlayer = game.Players:GetPlayerFromCharacter(VCharacter)
tagHumanoid(hit.Parent:FindFirstChild("Humanoid"),vPlayer)
hit.Parent.Humanoid:TakeDamage(30)
wait(0.05)
untagHumanoid(hit.Parent:FindFirstChild("Humanoid"))
end
end)
At the end, all I just want is to disable this function but I don’t know how.