local Tool = script.Parent local Remote = Tool:WaitForChild("Remote") local Handle = Tool:WaitForChild("Handle") local ArmMesh local HitAble = false local HitWindup = 0.15 local HitWindow = 0.75 local HitVictims = {} local SwingAble = true local SwingRestTime = 10 local function getPlayer() return game:GetService("Players"):GetPlayerFromCharacter(Tool.Parent) end local function contains(tbl, val) for _, v in ipairs(tbl) do if v == val then return true end end return false end local function ragdollCharacter(character) local savedJoints = {} for _, joint in ipairs(character:GetDescendants()) do if joint:IsA("Motor6D") then table.insert(savedJoints, { Name = joint.Name, Part0 = joint.Part0, Part1 = joint.Part1, C0 = joint.C0, C1 = joint.C1, Parent = joint.Parent }) local socket = Instance.new("BallSocketConstraint") local a1 = Instance.new("Attachment") local a2 = Instance.new("Attachment") a1.Parent = joint.Part0 a2.Parent = joint.Part1 socket.Parent = joint.Parent socket.Attachment0 = a1 socket.Attachment1 = a2 a1.CFrame = joint.C0 a2.CFrame = joint.C1 socket.LimitsEnabled = true socket.TwistLimitsEnabled = true joint:Destroy() end end task.delay(5, function() for _, info in ipairs(savedJoints) do if info.Part0.Parent and info.Part1.Parent then local newJoint = Instance.new("Motor6D") newJoint.Name = info.Name newJoint.Part0 = info.Part0 newJoint.Part1 = info.Part1 newJoint.C0 = info.C0 newJoint.C1 = info.C1 newJoint.Parent = info.Parent end end for _, desc in ipairs(character:GetDescendants()) do if desc:IsA("BallSocketConstraint") then desc:Destroy() end if desc:IsA("Attachment") and desc.Parent:IsA("BasePart") then desc:Destroy() end end end) end local function onTouched(part) if part:IsDescendantOf(Tool.Parent) or not HitAble then return end local character = part.Parent local humanoid = character:FindFirstChild("Humanoid") local root = character:FindFirstChild("HumanoidRootPart") local myRoot = Tool.Parent:FindFirstChild("HumanoidRootPart") if humanoid and root and myRoot and not contains(HitVictims, humanoid) then local backwardDir = myRoot.CFrame.LookVector local bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(1e9, 1e9, 1e9) bv.Velocity = backwardDir * 80 + Vector3.new(0, 80, 0) -- empuje hacia atrĂ¡s + vertical bv.Parent = root game:GetService("Debris"):AddItem(bv, 0.1) ragdollCharacter(character) table.insert(HitVictims, humanoid) Handle.Smack.Pitch = math.random(90, 110) / 100 Handle.Smack.TimePosition = 0.15 Handle.Smack:Play() end end local function onEquip() local arm = Tool.ArmMesh:Clone() arm.Parent = Tool.Parent:FindFirstChild("Right Arm") ArmMesh = arm end local function onUnequip() if ArmMesh then ArmMesh:Destroy() ArmMesh = nil end end local function onLeftDown() if not SwingAble then return end SwingAble = false delay(SwingRestTime, function() SwingAble = true end) delay(HitWindup, function() HitAble = true delay(HitWindow, function() HitAble = false end) end) HitVictims = {} Remote:FireClient(getPlayer(), "PlayAnimation", "Swing") task.wait(0.25) Handle.Boom.Pitch = math.random(80, 100) / 100 Handle.Boom:Play() end local function onRemote(player, func, ...) if player == getPlayer() and func == "LeftDown" then onLeftDown(...) end end Tool.Equipped:Connect(onEquip) Tool.Unequipped:Connect(onUnequip) Handle.Touched:Connect(onTouched) Remote.OnServerEvent:Connect(onRemote)