when i pressure the enemy with knockback very hard is making torso motor6d weird,
btw colition is pre made, i follow a tutorial, and i fix some stuff and here the video and script
local module = {}
local dick = game.ServerStorage.MainStorage.ItemsToClone.Socket
local ragdol_data = require(script.Ragdoll_data)
function module:destroyjoints(char: Model)
local root = char:FindFirstChild("HumanoidRootPart")
root.Massless = false
for _, v in pairs(char:GetDescendants()) do
if v.Name == "attachment_Join" or v.Name == "ragdollconstraint" then v:Destroy() end
if not v:IsA("BasePart") or v:FindFirstAncestorOfClass("Accessory") or v.Name == "Torso" or v.Name == "Neck" then continue end
end
end
function module:enablemotor6(char: Model, bool: boolean?)
for _, v in pairs(char:GetDescendants()) do
if v.Name == "Handle" or v.Name == "RootJoint" or v.Name == "Neck" then continue end
if v:IsA("Motor6D") then
v.Enabled = bool
end
if v:IsA("BasePart") then
v.CollisionGroup = if bool then
"character"
else
"Ragdoll"
end
end
end
function module:enablejoints(char: Model)
local root = char:FindFirstChild("HumanoidRootPart")
for _, v in pairs(char:GetChildren()) do
if not v:IsA("BasePart") or v:FindFirstChildOfClass("Accessory") or v.Name == "Handle" or v.Name == "Torso" or v.Name == "HumanoidRootPart" then
continue
end
if not ragdol_data[v.Name] then continue end
local a0: Attachment, a1: Attachment = Instance.new("Attachment"), Instance.new("Attachment")
local copy = dick:Clone()
copy.Name = "ragdollconstraint"
a0.Name = "attachment_Join"
a0.Parent = v
a0.CFrame = ragdol_data[v.Name].CFrame[2]
a1.Name = "attachment_Join"
a1.Parent = root
a1.CFrame = ragdol_data[v.Name].CFrame[1]
copy.Attachment0 = a0
copy.Attachment1 = a1
copy.Parent = v
v.Massless = true
end
end
function module:coito(char: Model, bool)
for _, v in pairs(char:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
v.CanCollide = not bool
v.DICKBALLS.CanCollide = bool
end
end
end
function module:enableragdoll(character: Model, duration: number?)
local player = game.Players:GetPlayerFromCharacter(character)
local hum = character:FindFirstChildOfClass("Humanoid")
local root = character:FindFirstChild("HumanoidRootPart")
if not root then return end
module:enablemotor6(character, false)
module:enablejoints(character)
module:coito(character, true)
if player then
game.ReplicatedStorage.Combat.Ragdoll_Client:FireClient(player)
else
root:SetNetworkOwner(nil)
root.Massless = true
hum.AutoRotate = false
hum.PlatformStand = true
end
--duration sooner
end
function module:unragdoll(character: Model, getupstate: number?)
local player = game.Players:GetPlayerFromCharacter(character)
local hum = character:FindFirstChildOfClass("Humanoid")
local root = character:FindFirstChild("HumanoidRootPart")
if not root then return end
if player then
game.ReplicatedStorage.Combat.UnRagdoll_Client:FireClient(player)
else
root:SetNetworkOwner(character)
root.Massless = false
hum.RootPart.CFrame = CFrame.new(root.Position)
if hum:GetState() == Enum.HumanoidStateType.Dead then return end
hum.PlatformStand = false
hum:SetStateEnabled(Enum.HumanoidStateType.Freefall, true)
hum:ChangeState(Enum.HumanoidStateType.GettingUp)
end
module:destroyjoints(character)
module:enablemotor6(character, true)
module:coito(character, false)
hum.AutoRotate = true
end
return module