What I want to achieve:
I want to make a script that allows players to push each other and make the pushed player a ragdoll for 2 seconds then unragdoll the pushed player.
The issue is that my ragdoll is shaking and I want it to just stay still.
Here is a video of the issue
I tried to disable players animation but that didn’t work and I tried changing humanoid values but that didn’t work either.
This is the server script:
rs.RagdollRemote:FireClient(plrTarget,true)
for index,joint in pairs(Target:GetDescendants()) do
if joint:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local a1 = Instance.new("Attachment")
local a2 = Instance.new("Attachment")
a1.Parent = joint.Part0
a2.Parent = joint.Part1
socket.Parent = joint.Parent
socket.Attachment0 = a1
socket.Attachment1 = a2
a1.CFrame = joint.C0
a2.CFrame = joint.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
joint.Enabled = false
end
end
wait(2)
for index,joint in pairs(Target:GetDescendants()) do
if joint:IsA("Motor6D") then
joint.Enabled = true
end
end
rs.RagdollRemote:FireClient(plrTarget,false)
This is the client script
local char = script.Parent
local humanoid = char:WaitForChild("Humanoid")
game.ReplicatedStorage.RagdollRemote.OnClientEvent:Connect(function(enable)
if enable then
char.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
else
char.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end)