Ragdoll script half works

basically, i have a ragdoll script that when the players health goes below 15 (or equal to) the player will ragdoll, now with an else if, (or just and else) the players health goes above 15, then player should unragdoll.
the ragdoll when the players health goes below 15 works, the unragdoll doesnt, no errors either

(keep in mind this isnt one simple local script, as i want the server to detect the ragdoll too)

dont steal my scripts >:(
if health <= 15 and not Toggle then

Remove “and not Toggle”

Try this:

Humanoid.HealthChanged:Connect(function(health)
   if health <= 15 and not Toggle then
      Toggle = true

      game.ReplicatedStorage.RagdollEvents.Ragdoll:FireServer(true)
   elseif health > 15 and Toggle then
      Toggle = false

      game.ReplicatedStorage.RagdollEvents.Ragdoll:FireServer(false)
   end
end)
2 Likes

i need that for other reasons, and it has no effect, removing it does nothing