Not to sure what you want but here is a code for when you press R the torso ragdolls
local player = game.Players.LocalPlayer
local userInputService = game:GetService("UserInputService")
local torso
local ragdolling = false
function findTorso(character)
for _, part in pairs(character:GetChildren()) do
if part:IsA("MeshPart") and part.Name == "HumanoidRootPart" then
return part
end
end
end
function ragdollTorso()
if torso then
torso.Anchored = false
while ragdolling and torso do
torso.CFrame = torso.CFrame * CFrame.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1))
wait(0.1)
end
end
end
function onKeyPress(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.R then
torso = findTorso(player.Character)
if torso then
ragdolling = true
ragdollTorso()
end
end
end
function onKeyRelease(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.R then
ragdolling = false
if torso then
torso.Anchored = true
end
end
end
userInputService.InputBegan:Connect(onKeyPress)
userInputService.InputEnded:Connect(onKeyRelease)
local player = game.Players.LocalPlayer
local userInputService = game:GetService("UserInputService")
local rightArm
local ragdolling = false
function findRightArm(character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
local rig = humanoid.RigType
if rig == Enum.HumanoidRigType.R15 then
return character:FindFirstChild("Right Arm")
elseif rig == Enum.HumanoidRigType.R6 then
return character:FindFirstChild("Right Arm")
end
end
end
function ragdollArm()
if rightArm then
rightArm.Anchored = false
while ragdolling and rightArm do
rightArm.CFrame = rightArm.CFrame * CFrame.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1))
wait(0.1)
end
end
end
function onKeyPress(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.R then
rightArm = findRightArm(player.Character)
if rightArm then
ragdolling = true
ragdollArm()
end
end
end
function onKeyRelease(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.R then
ragdolling = false
if rightArm then
rightArm.Anchored = true
end
end
end
userInputService.InputBegan:Connect(onKeyPress)
userInputService.InputEnded:Connect(onKeyRelease)