You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to make a part that ragdolls a player when touched.
What is the issue? Include screenshots / videos if possible!
I have no idea how to get started.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have run through the devforum but the scripts provided either ragdolls only on death or it is too complicated.
I have never done ragdolling scripts before, so I’m sorry if there are things that I don’t understand.
If its r15 the i found this topic, This Will Help.
or if you want to fall like ragdoll without a moving only a jump then HumanoidStateType will help
EXAMPLE RAGDOLL CODE FROM HUMANOIDSTATETYPE
make localscript and put localscript into startercharacterscripts
game:GetService("UserInputService").InputBegan:Connect(function(input, gameProccesed) --function for USERINPUTSERVICE
if input.KeyCode == Enum.KeyCode.R then -- if R key is pressed
game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"):ChangeState(Enum.HumanoidStateType.Ragdoll) -- changes state
end
end)
part touching script ragdoll (with a module)
local cooldown = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local module = require(game.ServerScriptService.Module)
module.Ragdoll(plr.Character)
cooldown = true
wait(1)
cooldown = false
end
end)
part touching without a module
local cooldown = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
hit.Parent:FindFirstChild("HumanoidRootPart"):SetNetworkOwner(nil)
plr.Character:FindFirstChildWhichIsA("Humanoid"):ChangeState(Enum.HumanoidStateType.Ragdoll)
cooldown = true
wait(1)
cooldown = false
end
end)
i added cooldown so when a player touches you have to wait 1 seconds.
for a part please use script and put script into part
I found the community resource pretty helpful! The problem is that it contains a lot of information, and I have no idea how to convert the script from ragdolling upon inputting a key to just touching a part. The ragdoll is pretty smooth
The ragdoll works now! Except… for some reason the player is not guaranteed to get up. After they ragdoll, theres a good chance that they are permanently stuck onto the ground, and are unable to get up. Is there a solution to this? I tried changng the humanoid state type but i realised that the ragdoll script used doesnt change he humanoid state type at all.
Hey, I got notified that you linked my post and just wanted to mention that the post sent is a little outdated.
I’ve created my own ragdoll script that works really well and although I can’t share it, I can give a good piece of advice.
Try avoid setting the network owner for a ragdoll on a server script. Instead, make a remote event and add a client script to “starter player/starter character” (I prefer starter character) that is responsible for setting the humanoid state type when the event is fired. Doing so makes the character → ragdoll transition much smoother and removes a lot of the ‘choppyness’ seen in a lot of ragdoll code.
I dont know much about this thread or the problem but I hope this little bit of advice can help:
Ragdoll is a bool value that is responsible for activating the ragdoll in my code. Replace this with your remote event’s onclient event
-- Script.Parent = StarterCharacter
--REPLACE ragdoll.Changed TO AN EVENT YOU CREATE
ragdoll.Changed:Connect(function(newVal)
if newVal then
humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
else
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
end
end)