Guys, here are a scripts:
just script:
char = script.Parent.Parent.Parent.Character
joints = {}
glues = {}
humanoid = nil
function onSelected(mouse)
local torso = char:findFirstChild("Torso")
if torso == nil then return end
local c = torso:GetChildren()
for i = 1, #c do
if c[i]:IsA("JointInstance") then
table.insert(joints,c[i])
local glue = Instance.new("Rotate")
glue.C0 = c[i].C0
glue.C1 = c[i].C1
glue.Part0 = c[i].Part0
glue.Part1 = c[i].Part1
glue.Name = c[i].Name
table.insert(glues,glue)
c[i].Part1.CanCollide = true
c[i].Parent = nil
glue.Parent = torso
end
end
local k = char:GetChildren()
for i = 1,#k do
if k[i].className == "Hat" then
if k[i]:findFirstChild("Handle") ~= nil then
local weld = Instance.new("Weld")
weld.Name = "Weld"
weld.Part0 = char.Head
weld.Part1 = k[i].Handle
weld.C0 = char.Head.CFrame:inverse()
weld.C1 = k[i].Handle.CFrame:inverse()
weld.Parent = k[i].Handle
end
end
end
humanoid = char:findFirstChild("Humanoid")
if humanoid ~= nil then humanoid.Parent = nil end
end
function onDeselected(mouse)
for i = 1, #glues do
glues[i]:remove()
end
for i = 1, #joints do
joints[i].Parent = char:findFirstChild("Torso")
end
--[[local k = char:GetChildren()
for i = 1,#k do
if k[i].className == "Hat" then
if k[i]:findFirstChild("Handle") ~= nil then
k[i].Handle.Weld:remove()
end
end
end]]
if humanoid ~= nil then humanoid.Parent = char end
end
--script.Parent.Selected:connect(onSelected)
--script.Parent.Deselected:connect(onDeselected)
script.Parent.Equipped:Connect(onSelected)
script.Parent.Unequipped:Connect(onDeselected)
server(name of script)
local punch = script.Parent
local remote = punch.Remote
local hitpart = punch.HitPart
local humanoidlist = {}
local touch
local debris = game:GetService("Debris")
local char
local hrp
function CheckHumanoid(hum)
for i, v in pairs(humanoidlist) do
if humanoidlist[i] == hum then
return true
end
end
return false
end
function Velocity(x, y, z, maxtorque, maxforce, vector, hit)
local attachment = Instance.new("Attachment", hit)
local linear = Instance.new("LinearVelocity", hit)
linear.MaxForce = maxforce
linear.Attachment0 = attachment
linear.RelativeTo = Enum.ActuatorRelativeTo.World
linear.VectorVelocity = vector
local angular = Instance.new("AngularVelocity", hit)
angular.MaxTorque = maxtorque
angular.AngularVelocity = Vector3.new(x, y, z)
angular.Attachment0 = attachment
angular.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
debris:AddItem(angular, 0.5)
debris:AddItem(linear, 0.5)
debris:AddItem(attachment, 0.5)
end
local function initialize()
punch.Enabled = true
char = punch.Parent
hrp = char:FindFirstChild("HumanoidRootPart")
local weld = hitpart:FindFirstChild("Weld")
if weld then
weld.Part0 = char:FindFirstChild("Right Arm")
weld.Part1 = hitpart
end
local humanoid = char:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.Died:Connect(function()
punch.Enabled = false
if touch then
touch:Disconnect()
touch = nil
end
end)
end
end
function cooldown()
coroutine.wrap(function()
punch.Enabled = false
local cooldownTime = 10 -- Установка времени отката на 10 секунд
local interval = 0.1
local steps = cooldownTime / interval
for i = 1, steps do
punch.Name = "[" .. string.format("%.1f", cooldownTime - (i * interval)) .. "]"
wait(interval)
end
punch.Name = "Haymaker"
punch.Enabled = true
end)()
end
function ApplyRagdoll(character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.Health > 0 then
humanoid:ChangeState(Enum.HumanoidStateType.Physics)
end
for _, part in pairs(character:GetChildren()) do
if part:IsA("BasePart") and part ~= hrp then
part:SetNetworkOwner(nil)
if part:FindFirstChildOfClass("Motor6D") then
local constraint = Instance.new("BallSocketConstraint")
constraint.Parent = part
constraint.Attachment0 = Instance.new("Attachment", part)
constraint.Attachment1 = Instance.new("Attachment", part.Parent:FindFirstChild(part.Name))
debris:AddItem(constraint, 2)
end
end
end
wait(2)
if humanoid and humanoid.Health > 0 then
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
for _, part in pairs(character:GetChildren()) do
if part:IsA("BasePart") and part ~= hrp then
part:SetNetworkOwner(game.Players:GetPlayerFromCharacter(character))
end
end
end
remote.OnServerInvoke = function(plr, action)
if action == "Swing" then
if punch.Enabled == true then
punch.Enabled = false
delay(0.2, function()
touch = hitpart.Touched:Connect(function(hit)
if hit and hit.Parent then
local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
if hum then
local check = CheckHumanoid(hum)
local otherhrp = hit.Parent:FindFirstChild("HumanoidRootPart")
if otherhrp and hrp then
local delta = otherhrp.Position - hrp.Position
if not check then
table.insert(humanoidlist, hum)
Velocity(0, 0, 25, 40, 9999999, delta * 20, otherhrp) -- Увеличен импульс
hum:TakeDamage(10)
hitpart.Hit:Play()
ApplyRagdoll(hit.Parent)
-- Add creator tag
local creatorTag = Instance.new("ObjectValue")
creatorTag.Name = "creator"
creatorTag.Value = plr
creatorTag.Parent = hum
debris:AddItem(creatorTag, 2) -- Adjust duration as needed
wait(1)
humanoidlist = {}
end
end
end
end
end)
end)
delay(1, function()
if touch then
touch:Disconnect()
touch = nil
end
end)
cooldown()
return true
end
end
end
punch.Equipped:Connect(initialize)
punch.SwingSound.OnServerEvent:Connect(function(plr)
hitpart.Swing:Play()
end)
tool handler
local tool = script.Parent
local debounce = true
tool.Activated:Connect(function()
if debounce == true then
debounce = false
wait(tool.Cooldown.Value)
debounce = true
end
end)
tool.HitPart.Touched:Connect(function(hit) -- Ragdoll
if debounce == false then
script.Disabled = true
local Ragdoll = require(game.ServerScriptService.Module)
Ragdoll.Start(hit.Parent)
local force = Instance.new("BodyVelocity", hit.Parent.HumanoidRootPart)
force.MaxForce = Vector3.new(2,2,2) * math.huge
local direction = (hit.Parent.HumanoidRootPart.CFrame.Position - tool.Parent.HumanoidRootPart.CFrame.Position).Unit
force.Velocity = (direction + Vector3.new(0,1,0)).Unit * 25
local rotation = Instance.new("BodyAngularVelocity", hit.Parent.HumanoidRootPart)
rotation.AngularVelocity = Vector3.new(1,1,1) * math.pi * 5
rotation.MaxTorque = Vector3.new(2,2,2) * math.huge
rotation.P = 5000
tool.Handle.Slap:Play()
wait(0.35)
force:Destroy()
rotation:Destroy()
script.Disabled = false
wait(math.random(1.25, 3.15))
Ragdoll.Stop(hit.Parent)
end
end)
client
local punch = script.Parent
local hitpart = punch.HitPart
local anim = punch:WaitForChild("Animations")
local remote = punch:WaitForChild("Remote")
local char = game.Players.LocalPlayer.Character
local lhum = char:FindFirstChildOfClass("Humanoid")
local loadswing = lhum:LoadAnimation(anim:WaitForChild("Swing1"))
local loadidle = lhum:LoadAnimation(anim:WaitForChild("Idle"))
local sound = punch:WaitForChild("SwingSound")
local equipped = false
punch.Equipped:Connect(function(mouse)
equipped = true
loadidle:Play()
punch.Unequipped:Connect(function()
equipped = false
if loadswing then
loadswing:Stop()
end
loadidle:Stop()
end)
end)
punch.Activated:Connect(function()
if punch.Enabled == true and equipped == true then
loadswing:Play()
local invoke = remote:InvokeServer("Swing")
if invoke == true then
loadswing.KeyframeReached:Connect(function(name)
if name == "Sound" then
sound:FireServer()
end
end)
end
end
end)