Make a script and put it in serverscript service:
local RemoteEvent = Instance.new("RemoteEvent",game.ReplicatedStorage)
RemoteEvent.Name = "Ragdoll"
RemoteEvent.OnServerEvent:Connect(function(Player,RigType,Ragdolling)
Player.Character.Humanoid.BreakJointsOnDeath = false
if RigType == Enum.HumanoidRigType.R6 and Ragdolling == false then
Player.Character.Humanoid.PlatformStand = true
while Player.Character.Torso:FindFirstChildWhichIsA("Attachment") do
script.Parent.Torso:FindFirstChildWhichIsA("Attachment"):Remove()
end
for i,v in pairs(Player.Character.Torso:GetChildren()) do
if v.ClassName == "Motor6D" then
v.Enabled = false
end
end
for i,v in pairs(Player.Character:GetChildren()) do
if v.ClassName == "Part" then
v.CanCollide = true
end
end
local HA1 = Instance.new("Attachment",script.Parent.Head)
local HA2 = Instance.new("Attachment",script.Parent.Torso)
local RAA1 = Instance.new("Attachment",script.Parent["Right Arm"])
local RAA2 = Instance.new("Attachment",script.Parent.Torso)
local LAA1 = Instance.new("Attachment",script.Parent["Left Arm"])
local LAA2 = Instance.new("Attachment",script.Parent.Torso)
local RLA1 = Instance.new("Attachment",script.Parent["Right Leg"])
local RLA2 = Instance.new("Attachment",script.Parent.Torso)
local LLA1 = Instance.new("Attachment",script.Parent["Left Leg"])
local LLA2 = Instance.new("Attachment",script.Parent.Torso)
local HC = Instance.new("BallSocketConstraint",script.Parent.Torso)
local RAC = Instance.new("BallSocketConstraint",script.Parent.Torso)
local LAC = Instance.new("BallSocketConstraint",script.Parent.Torso)
local RLC = Instance.new("BallSocketConstraint",script.Parent.Torso)
local LLC = Instance.new("BallSocketConstraint",script.Parent.Torso)
HA1.Position = Vector3.new(0,-0.5,0)
RAA1.Position = Vector3.new(-0.5,1,0)
LAA1.Position = Vector3.new(0.5,1,0)
RLA1.Position = Vector3.new(0,1,0)
LLA1.Position = Vector3.new(0,1,0)
HA2.Position = Vector3.new(0,1,0)
RAA2.Position = Vector3.new(1,1,0)
LAA2.Position = Vector3.new(-1,1,0)
RLA2.Position = Vector3.new(0.5,-1,0)
LLA2.Position = Vector3.new(-0.5,-1,0)
HC.Attachment0 = HA2
HC.Attachment1 = HA1
RAC.Attachment0 = RAA2
RAC.Attachment1 = RAA1
LAC.Attachment0 = LAA2
LAC.Attachment1 = LAA1
RLC.Attachment0 = RLA2
RLC.Attachment1 = RLA1
LLC.Attachment0 = LLA2
LLC.Attachment1 = LLA1
elseif RigType == Enum.HumanoidRigType.R6 and Ragdolling == true then
Player.Character.PlatformStand = false
for i,v in pairs(Player.Character.Torso:GetChildren()) do
if v.ClassName == "Motor6D" then
v.Enabled = true
end
end
elseif RigType == Enum.HumanoidRigType.R15 and Ragdolling == false then
Player.Character.Humanoid.PlatformStand = true
Player.Character.Head:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.UpperTorso:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.LowerTorso:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.RightUpperArm:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.RightLowerArm:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.RightHand:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.LeftUpperArm:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.LeftLowerArm:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.LeftHand:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.RightUpperLeg:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.RightLowerLeg:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.RightFoot:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.LeftUpperLeg:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.LeftLowerLeg:FindFirstChildWhichIsA("Motor6D").Enabled = false
Player.Character.LeftFoot:FindFirstChildWhichIsA("Motor6D").Enabled = false
local HC = Instance.new("BallSocketConstraint",Player.Character.UpperTorso)
local TC = Instance.new("BallSocketConstraint",Player.Character.LowerTorso)
local RUAC = Instance.new("BallSocketConstraint",Player.Character.UpperTorso)
local RLAC = Instance.new("BallSocketConstraint",Player.Character.RightUpperArm)
local RHC = Instance.new("BallSocketConstraint",Player.Character.RightLowerArm)
local LUAC = Instance.new("BallSocketConstraint",Player.Character.UpperTorso)
local LLAC = Instance.new("BallSocketConstraint",Player.Character.LeftUpperArm)
local LHC = Instance.new("BallSocketConstraint",Player.Character.LeftLowerArm)
local RULC = Instance.new("BallSocketConstraint",Player.Character.LowerTorso)
local RLLC = Instance.new("BallSocketConstraint",Player.Character.RightUpperLeg)
local RFC = Instance.new("BallSocketConstraint",Player.Character.RightLowerLeg)
local LULC = Instance.new("BallSocketConstraint",Player.Character.LowerTorso)
local LLLC = Instance.new("BallSocketConstraint",Player.Character.LeftUpperLeg)
local LFC = Instance.new("BallSocketConstraint",Player.Character.LeftLowerLeg)
HC.Attachment0 = Player.Character.UpperTorso.NeckRigAttachment
HC.Attachment1 = Player.Character.Head.NeckRigAttachment
TC.Attachment0 = Player.Character.LowerTorso.WaistRigAttachment
TC.Attachment1 = Player.Character.UpperTorso.WaistRigAttachment
RUAC.Attachment0 = Player.Character.UpperTorso.RightShoulderRigAttachment
RUAC.Attachment1 = Player.Character.RightUpperArm.RightShoulderRigAttachment
RLAC.Attachment0 = Player.Character.RightUpperArm.RightElbowRigAttachment
RLAC.Attachment1 = Player.Character.RightLowerArm.RightElbowRigAttachment
RHC.Attachment0 = Player.Character.RightLowerArm.RightWristRigAttachment
RHC.Attachment1 = Player.Character.RightHand.RightWristRigAttachment
LUAC.Attachment0 = Player.Character.UpperTorso.LeftShoulderRigAttachment
LUAC.Attachment1 = Player.Character.LeftUpperArm.LeftShoulderRigAttachment
LLAC.Attachment0 = Player.Character.LeftUpperArm.LeftElbowRigAttachment
LLAC.Attachment1 = Player.Character.LeftLowerArm.LeftElbowRigAttachment
LHC.Attachment0 = Player.Character.LeftLowerArm.LeftWristRigAttachment
LHC.Attachment1 = Player.Character.LeftHand.LeftWristRigAttachment
RULC.Attachment0 = Player.Character.LowerTorso.RightHipRigAttachment
RULC.Attachment1 = Player.Character.RightUpperLeg.RightHipRigAttachment
RLLC.Attachment0 = Player.Character.RightUpperLeg.RightKneeRigAttachment
RLLC.Attachment1 = Player.Character.RightLowerLeg.RightKneeRigAttachment
RFC.Attachment0 = Player.Character.RightLowerLeg.RightAnkleRigAttachment
RFC.Attachment1 = Player.Character.RightFoot.RightAnkleRigAttachment
LULC.Attachment0 = Player.Character.LowerTorso.LeftHipRigAttachment
LULC.Attachment1 = Player.Character.LeftUpperLeg.LeftHipRigAttachment
LLLC.Attachment0 = Player.Character.LeftUpperLeg.LeftKneeRigAttachment
LLLC.Attachment1 = Player.Character.LeftLowerLeg.LeftKneeRigAttachment
LFC.Attachment0 = Player.Character.LeftLowerLeg.LeftAnkleRigAttachment
LFC.Attachment1 = Player.Character.LeftFoot.LeftAnkleRigAttachment
elseif RigType == Enum.HumanoidRigType.R15 and Ragdolling == true then
Player.Character.Humanoid.PlatformStand = false
Player.Character.Head:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.UpperTorso:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.LowerTorso:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.RightUpperArm:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.RightLowerArm:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.RightHand:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.LeftUpperArm:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.LeftLowerArm:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.LeftHand:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.RightUpperLeg:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.RightLowerLeg:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.RightFoot:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.LeftUpperLeg:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.LeftLowerLeg:FindFirstChildWhichIsA("Motor6D").Enabled = true
Player.Character.LeftFoot:FindFirstChildWhichIsA("Motor6D").Enabled = true
end
end)
Now put this local script in ReplicatedFirst:
local UIS = game:GetService("UserInputService")
Ragdolling = false
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.F then
Ragdolling = not Ragdolling
if Ragdolling == false then
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Head
elseif Ragdolling == true then
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
end
game.ReplicatedStorage:FindFirstChild("Ragdoll"):FireServer(game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").RigType,Ragdolling)
end
end)