#my ragdoll doesn't work
1 messages · Page 1 of 1 (latest)
local remote = game:GetService("ReplicatedStorage")
local remotrg = remote:WaitForChild("Ragdoll")
remotrg.OnServerEvent:Connect(function(plr, chara, humanoid, timing, ragdolled)
humanoid:ChangeState(Enum.HumanoidStateType.Physics)
humanoid.PlatformStand = true
print("hi how are ya")
for i, part in pairs(chara:GetChildren()) do
if part:IsA("BasePart") then
part.CanCollide = true
end
end
for i, joints in pairs(chara:GetDescendants()) do
if joints:IsA("Motor6D") and joints.Name ~= "Neck" then
print("hello from the server alohA")
local prnt = joints.Parent
local pt1 = joints.Part1
local pt0 = joints.Part0
pt0.CanCollide = true
pt1.CanCollide = true
local preserve = joints:Clone()
preserve.Part0 = nil
preserve.Part1 = nil
preserve.Parent = script.Joints
local a1 = Instance.new("Attachment")
local a2 = Instance.new("Attachment")
a1.Parent = pt0
a2.Parent = pt1
a1.CFrame = joints.C0
a2.CFrame = joints.C1
local socket = Instance.new("BallSocketConstraint")
socket.Parent = prnt
socket.Attachment0 = a1
socket.Attachment1 = a2
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
joints:Destroy()
end
end
end)
** You are now Level 2! **
humanoid controls cancollide on the client so setting it server side gets overridden
add a RunService.Stepped loop in a localscript that sets cancollide true on the limbs every frame
ok
it's kinda weird how it does work on the second time tho