I'm new to scripting so scripts I make is sometimes too confusing to read. :(
local debounce = false
script.Parent.Equipped:Connect(function(mouse)
local wield = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Wield)
wield:Play()
mouse.Button1Down:Connect(function()
if not debounce then
debounce = true
local wield = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Wield)
local lunge = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Lunge)
wield:Stop()
lunge:Play()
debounce = false
end
end)
mouse.Button1Up:Connect(function()
if not debounce then
debounce = true
script.Parent.CanDamage.Value = true
local wield = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Wield)
local slash = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Slash)
slash:Play()
wait(1)
slash:Stop()
wield:Play()
script.Parent.Blade.Touched:Connect(function(hit)
if script.Parent.CanDamage.Value == true then
script.Parent.CanDamage.Value = false
hit.Parent.Humanoid:TakeDamage(100)
end
end)
wait(.1)
debounce = false
end
end)
end)
