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)

1 comment
It's not the problem, still not working properly