Skip to main content

Ragdoll

Ragdoll package for converting a player's character into a ragdoll.

Install with wally by adding the following to your wally.toml:

Ragdoll = "dig1t/ragdoll@1.0.4"

Properties

isCollidable

Ragdoll.isCollidable: boolean

Whether or not the ragdoll is collidable (default: false)

destroyTime

Ragdoll.destroyTime: number

Seconds before the ragdoll is destroyed (default: 5)

Functions

setup

Ragdoll.setup(
characterModel--

The player's character

) → ()

Sets up the player's collision group and sets the RagdollReady attribute to true.

This should be run when the player's character is created or loaded.

playerDied

Ragdoll.playerDied(
playerPlayer,--

The player

parentInstance?,--

The parent of the ragdoll

destroyTimenumber?,--

The time in seconds before the ragdoll is destroyed

keepRagdollInWorldboolean?--

Whether or not to keep the ragdoll in the world

) → ()

Converts the player's character into a ragdoll and removes the player's character.

This should be run when the player dies.

Show raw api
{
    "functions": [
        {
            "name": "setup",
            "desc": "Sets up the player's collision group and sets the RagdollReady attribute to true.\n\nThis should be run when the player's character is created or loaded.",
            "params": [
                {
                    "name": "character",
                    "desc": "The player's character",
                    "lua_type": "Model"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 48,
                "path": "src/Ragdoll/init.luau"
            }
        },
        {
            "name": "playerDied",
            "desc": "Converts the player's character into a ragdoll and removes the player's character.\n\nThis should be run when the player dies.",
            "params": [
                {
                    "name": "player",
                    "desc": "The player",
                    "lua_type": "Player"
                },
                {
                    "name": "parent",
                    "desc": "The parent of the ragdoll",
                    "lua_type": "Instance?"
                },
                {
                    "name": "destroyTime",
                    "desc": "The time in seconds before the ragdoll is destroyed",
                    "lua_type": "number?"
                },
                {
                    "name": "keepRagdollInWorld",
                    "desc": "Whether or not to keep the ragdoll in the world",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 164,
                "path": "src/Ragdoll/init.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "isCollidable",
            "desc": "Whether or not the ragdoll is collidable (default: false)",
            "lua_type": "boolean",
            "source": {
                "line": 31,
                "path": "src/Ragdoll/init.luau"
            }
        },
        {
            "name": "destroyTime",
            "desc": "Seconds before the ragdoll is destroyed (default: 5)",
            "lua_type": "number",
            "source": {
                "line": 39,
                "path": "src/Ragdoll/init.luau"
            }
        }
    ],
    "types": [],
    "name": "Ragdoll",
    "desc": "Ragdoll package for converting a player's character into a ragdoll.\n\nInstall with wally by adding the following to your `wally.toml`:\n```toml\nRagdoll = \"dig1t/ragdoll@1.0.4\"\n```",
    "source": {
        "line": 21,
        "path": "src/Ragdoll/init.luau"
    }
}