Skip to main content

Ragdoll

Base class for ragdolls, meant to be used with binders. This class exports a Binder. While a humanoid is bound with this class, it is ragdolled.

tip

Initialize this whole system through RagdollService.

-- Be sure to do the service init on the client too
local ServiceBag = require("ServiceBag")
local Ragdoll = require("Ragdoll")

local serviceBag = ServiceBag.new()
serviceBag:GetService(require("RagdollService"))

serviceBag:Init()
serviceBag:Start()

-- Enable ragdoll
Ragdoll:Tag(humanoid)

-- Disable ragdoll
Ragdoll:Untag(humanoid)

Functions

new

Ragdoll.new(
humanoidHumanoid,
_serviceBagServiceBag
) → Ragdoll

Constructs a new Ragdoll. Should be done via Binder. See RagdollBindersServer.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new Ragdoll. Should be done via [Binder]. See [RagdollBindersServer].",
            "params": [
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                },
                {
                    "name": "_serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Ragdoll"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 45,
                "path": "src/ragdoll/src/Server/Classes/Ragdoll.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Ragdoll",
    "desc": "Base class for ragdolls, meant to be used with binders. This class exports a [Binder].\nWhile a humanoid is bound with this class, it is ragdolled.\n\n:::tip\nInitialize this whole system through [RagdollService].\n:::\n\n```lua\n-- Be sure to do the service init on the client too\nlocal ServiceBag = require(\"ServiceBag\")\nlocal Ragdoll = require(\"Ragdoll\")\n\nlocal serviceBag = ServiceBag.new()\nserviceBag:GetService(require(\"RagdollService\"))\n\nserviceBag:Init()\nserviceBag:Start()\n\n-- Enable ragdoll\nRagdoll:Tag(humanoid)\n\n-- Disable ragdoll\nRagdoll:Untag(humanoid)\n```",
    "source": {
        "line": 29,
        "path": "src/ragdoll/src/Server/Classes/Ragdoll.lua"
    }
}