local Players = game:GetService("Players") local player = Players.LocalPlayer local workspace = game:GetService("Workspace") local tool = Instance.new("Tool") tool.Name = "?!??!?!??" tool.RequiresHandle = true tool.Parent = player.Backpack local handle = Instance.new("Part") handle.Name = "Handle" handle.Size = Vector3.new(0.9, 16, 0.9) handle.Color = Color3.fromRGB(163, 162, 165) handle.Material = Enum.Material.Plastic handle.CanCollide = true handle.Massless = true handle.Parent = tool local slashSound = Instance.new("Sound") slashSound.SoundId = "rbxasset://sounds/swordslash.wav" slashSound.Volume = 0.7 slashSound.Parent = handle local attacking = false local hitDebounce = {} local partDebounce = {} tool.Activated:Connect(function() if attacking then return end attacking = true slashSound:Play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = tool task.wait(0.4) attacking = false end) handle.Touched:Connect(function(hit) if not attacking or not hit or not hit:IsA("BasePart") then return end if hit:IsDescendantOf(tool) then return end if hit:IsDescendantOf(player.Character) then return end local character = hit.Parent local humanoid = character and character:FindFirstChildOfClass("Humanoid") if humanoid and character ~= player.Character then if hitDebounce[character] then return end hitDebounce[character] = true local root = character:FindFirstChild("HumanoidRootPart") if root then local explosion = Instance.new("Explosion") explosion.Position = root.Position explosion.BlastRadius = 0 explosion.BlastPressure = 0 explosion.DestroyJointRadiusPercent = 0 explosion.Parent = workspace end for _, obj in ipairs(character:GetDescendants()) do if obj:IsA("JointInstance") or obj:IsA("Constraint") then obj:Destroy() end end for _, part in ipairs(character:GetDescendants()) do if part:IsA("BasePart") then part:SetNetworkOwner(player) part.Anchored = false part.CanCollide = true part.Massless = false part.Velocity = Vector3.new(math.random(-5,5), math.random(-10,-5), math.random(-5,5)) part.RotVelocity = Vector3.new(math.random(-5,5), math.random(-5,5), math.random(-5,5)) end end humanoid.Health = 0 task.wait(5) character:Destroy() task.wait(1) hitDebounce[character] = nil else if partDebounce[hit] then return end partDebounce[hit] = true if hit.Anchored then hit.Anchored = false hit.CanCollide = true hit.Massless = false hit.Velocity = Vector3.new(math.random(-2,2), math.random(-1,0), math.random(-2,2)) end task.wait(1) partDebounce[hit] = nil end end) local function wearHat(assetId) local character = player.Character or player.CharacterAdded:Wait() local head = character:WaitForChild("Head") local success, objects = pcall(function() return game:GetObjects("rbxassetid://" .. assetId) end) if not success then return end local hatHandle for _, obj in ipairs(objects) do if obj:IsA("Accessory") then hatHandle = obj:FindFirstChild("Handle") break end local found = obj:FindFirstChild("Handle", true) if found and found:IsA("BasePart") then hatHandle = found break end end if not hatHandle then return end local accessory = Instance.new("Accessory") accessory.Name = "Hat_" .. assetId hatHandle.Name = "Handle" hatHandle.Parent = accessory accessory.Parent = character hatHandle:SetAttribute("IsHatHandle", true) hatHandle.CanCollide = false local attachment = hatHandle:FindFirstChildWhichIsA("Attachment") local headAttachment = attachment and head:FindFirstChild(attachment.Name) if headAttachment then hatHandle.CFrame = headAttachment.WorldCFrame * attachment.CFrame:Inverse() else hatHandle.CFrame = head.CFrame end local weld = Instance.new("WeldConstraint") weld.Part0 = hatHandle weld.Part1 = head weld.Parent = hatHandle end wearHat(1055299) wearHat(1527622)