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!
To respawn the character when in the ragdoll state.
- What is the issue? Include screenshots / videos if possible!
I’m just trying to make a simple ragdoll system, and so I need to turn off a few settings in the humanoid, like requiresneck = false, andPlatformStand = true and disable motor6D in the joints and temporarily replace them with ball socket constraints.
The problem starts is when entering the ragdoll state I start floating:
I have found that **humanoid.EvaluateStateMachine ** needs to be set to false (which I don’t understand why this is the case) which stops the floating glitch but now I have another issue, if i wanted to reset the players character it does not work.
- What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I am aware that EvaluateStateMachine monitors the state of the player including triggering the dead state. So I have tried to have a propertyChange on the humanoids health on the server:
local Players = game:GetService("Players")
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
print("Checking health")
humanoid:GetPropertyChangedSignal("Health"):Connect(function()
if humanoid.Health <= 0 then
print("Player has died")
humanoid.EvaluateStateMachine = true
humanoid.PlatformStand = false
local player = Players:GetPlayerFromCharacter(character)
if player then
task.delay(2, function()
print("Respawning player: ", player.Name)
player:LoadCharacter()
end)
end
end
end)
end
end
Players.PlayerAdded:Connect(function(plr)
print("Player has joined the game")
plr.CharacterAdded:Connect(function()
print("Player has respawned")
local Humanoid = plr.Character:WaitForChild("Humanoid")
if Humanoid then
onCharacterAdded(Humanoid.Parent)
end
end)
end)
So on creating the character I have a function to check if player health is zero or below I attempt to Reload the character BUT in the ragdoll state it just does not work at all on the server.
I just want a general idea of just how to manually respawn the player character or to resolve my first problem which in the ragdoll state it starts floating up.
EDIT: GetPropertyChangedSignal on the server does not work on the server consistently in the ragdoll state but still works normally.
I am really unsure what is causing this
These are the settings I change in the ragdoll state:
Even with EvaluateStateMachine still set true, and not changing some settings mentioned above it still remains inconsistent or just not checking the changedproperty of health on the server
I can upload any part of my ragdoll script if needed to be checked specifically.