#my ragdoll doesn't work

1 messages · Page 1 of 1 (latest)

drowsy pumice
#

for some reason it only triggers can collide on the second time (i haven't implemented getting up)

#
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)


mild bladeBOT
#

studio** You are now Level 2! **studio

drowsy pumice
#

also i just realized disabling the motor6ds are better

drowsy pumice
#

bmp

#

why doesn't bumping work

steady crater
#

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

drowsy pumice
#

it's kinda weird how it does work on the second time tho

steady crater
#

yeah thats because the humanoid overrides it the first frame

#

the stepped loop fixes that since it forces it before physics every frame