local tool = script.Parent
local handle = tool.Handle
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local character = player.Character
local equipAnim = character.Humanoid.Animator:LoadAnimation(game.ReplicatedStorage.SwordAnims.GreatswordEquip)
tool.Equipped:Connect(function()
equipAnim.Priority = Enum.AnimationPriority.Action3
equipAnim.Looped = true
equipAnim:Play()
end)
tool.Unequipped:Connect(function()
equipAnim:Stop()
end)
local m1 = character.Humanoid.Animator:LoadAnimation(game.ReplicatedStorage.SwordAnims.GreatM1)
m1.Priority = Enum.AnimationPriority.Action4
tool.Activated:Connect(function()
m1:Play()
local hitbox = Instance.new("Part")
hitbox.Size = Vector3.new(3, 9, 3)
hitbox.Massless = true
hitbox.Transparency = 0.5
hitbox.Anchored = false
hitbox.CanCollide = false
hitbox.CFrame = tool.Blade.CFrame
hitbox.Material = Enum.Material.ForceField
hitbox.Color = Color3.new(0,0,3)
hitbox.Parent = workspace
local weld = Instance.new("WeldConstraint")
weld.Parent = hitbox
weld.Part0 = hitbox
weld.Part1 = tool.Blade
while true do
local parts = workspace:GetPartsInPart(hitbox)
wait(0.1)
for i, part in pairs(parts) do
print(part)
if part.Parent:FindFirstChild("Humanoid") then
part.Parent.Humanoid:TakeDamage(5)
end
end
end
end)