I've been trying to do a sword deal damage with animation but i can only use it once for some reason. Here's the script
local script:
local Tool = script.Parent script.Parent.Activated:connect(function() Tool.RemoteEvent:FireServer() end)
script:
local Tool = script.Parent; local usable = true local Part = Tool.Handle.HitPart Tool.RemoteEvent.OnServerEvent:Connect(function(Player) if usable == true then usable = false local player = script.Parent.Parent local hum = player.Humanoid local a = player.Humanoid:LoadAnimation(Tool.Throw) a:Play() local ten = true Part.Touched:Connect(function(hit) if not ten then return end ten = false local ehum = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid") if ehum and ehum ~= hum then ehum:TakeDamage(15) wait(0.2) usable = true end end) end end)
Okay so the problem is on line script (not local script) it says: local Tool = script.Parent; the reason it doesnt work is because you put a semi-colon after Parent at the end of the line.
the proper way is: local Tool = script.Parent;