Local Script:
-- Var
local Player = game.Players.LocalPlayer
local Tool = script.Parent
local Remote = Tool:WaitForChild("Remote")
local Config = Tool:WaitForChild("Config")
repeat wait() until Player.Character
local Char = Player.Character
local Hum = Char:WaitForChild("Humanoid")
local Anim = Hum:LoadAnimation(script.Anim)
local CanSwing = true
local CanDamage = true
-- Animate
function Animate()
Anim:Play()
print("Animated")
end
Tool.Equipped:Connect(function()
Tool.Activated:Connect(function()
if (CanSwing) then
CanSwing = false
Animate()
Tool.Handle.Touched:Connect(function(hit)
if (hit.Parent:FindFirstChild("AI")) and CanDamage then
CanDamage = false
Remote:FireServer("Attack",hit.Parent)
end
end)
wait(Config.Speed.Value)
CanSwing = true
CanDamage = true
end
end)
end)
Doesn't Print Any Errors
