I’m trying to make a simple system where you can use the bodies of your allies to figure out who the killer is in a murder mystery style game.
I want these bodies to stay until removed by a script. The first thing I did was import a R6 ragdoll script from the library (yes, I checked it for viruses), but found that the body only stays for ~10 seconds. In a game where they can be your main clues, it doesn’t help that they just dissapear.
In desparation, I looked at some other scripts and tried to write a little bit myself, but to no avail. The body didn’t have a package (comes with the forced custom avatar), or the hat I provided with it.
I also did a few Google searches, but it just led me to more scripts that wouldn’t really help me. I’ve looked around in the player properties and couldn’t find anything like decay time.
If you have any questions about my project or would like a little more context, please let me know.
Thank you for participating in the Developer Forum and making Roblox a better place.
Instead of actually killing the character, just get them down to something that is not 0 health, and just detect if their health is in the respective range of “death.” You then can ragdoll the character, clone their body so that it stays there, and then just do :LoadCharacter()
the problem is with that the character is supposed to die permanently as if they were ‘eliminated’ from the game, similar to Flicker’s system, where once you die, youre dead
Yeah, I mean that you dont actually kill the player, since that renders their body as dead, and removes their body in ~10 seconds. You just simulate death, but reload their character in the lobby
Little side mention, 200 lines for a ragdoll script is unneccessarily long now since there is the new feature of DisableJointsBreakageOnDeath (something similar to that ), all you really need is around 24 lines, literally.
Heres a tutorial that can help you with that:
However, if you want to learn what the script actually does:
Essentially, it detects when the player joins the game, once deteced, it detects if a character is added/respawned for that certain player.
If a character is detected/added/respawned, it will disable the property “BreakJointsOnDeath” meaning no joints are broken, this is important later on.
After that, it detects when the player dies from the humanoid state. Once detected, it will for loop in pairs aka, grabbing the parts inside the character. It will then search for parts/instances relating to “Motor6D” (joints inside characters).
Once detected, it will begin replacing the parts with ballsocketconstraints giving it a ragdoll feel. Then it deletes the joints to “activate” the ragdoll making it flowy.
After that, it disable the rootpart so ragdoll limbs dont get stuck on the rootpart.
You can disable the death as per usual or set death/respawn rate to -1 or something similar.
Interesting. I don’t know much about Roblox’s engine as a whole so I didn’t know things like ballsockets existed, and I have no idea what Motor6Ds do, but I do know theyre necessary to have a functional avatar.