Roblox Sword Script

local tool = Instance.new("Tool")
tool.Name = "Sword"
tool.RequiresHandle = true
tool.CanBeDropped = false

local handle = Instance.new("Part")
handle.Name = "Handle"
handle.Size = Vector3.new(1, 5, 1)
handle.BrickColor = BrickColor.new("Bright red")
handle.Anchored = false
handle.CanCollide = false
handle.Parent = tool

tool.GripForward = Vector3.new(0, 0, 1)
tool.GripPos = Vector3.new(0, -1.5, 0)
tool.GripRight = Vector3.new(1, 0, 0)
tool.GripUp = Vector3.new(0, 1, 0)

tool.Equipped:Connect(function()
  local animation = Instance.new("Animation")
  animation.AnimationId = "rbxassetid://12345678" -- Change to your animation ID
  local track = tool.Parent.Humanoid:LoadAnimation(animation)
  track:Play()
end)

tool.Activated:Connect(function()
  if tool.Parent and tool.Parent:FindFirstChild("Humanoid") then
    local humanoid = tool.Parent.Humanoid
    humanoid.Health = 0
  end
end)

tool.Parent = game.Players.LocalPlayer.Backpack