Skip to main content

HumanoidKillerUtils

Tags and retrieves killer. This is the old API surface to register KOs in Roblox, and many legacy systems still use the creator tag. The contract is that an object value pointing to the killer will be put in the humanoid, and if it exists when the humanoid dies, then the killer is registered.

Functions

untagKiller

HumanoidKillerUtils.untagKiller(humanoidHumanoid) → ()

Removes all killer tags

tagKiller

HumanoidKillerUtils.tagKiller(
humanoidHumanoid,
attackerPlayer
) → ()

Tags the killer with a source.

tip

Be sure to tag the killer before applying damage.

getKillerHumanoidOfHumanoid

HumanoidKillerUtils.getKillerHumanoidOfHumanoid(humanoidHumanoid) → Humanoid?

Killer can either be a humanoid or a player (which we'll grab the humanoid)

getPlayerKillerOfHumanoid

HumanoidKillerUtils.getPlayerKillerOfHumanoid(humanoidHumanoid) → Player?

Killer must be a player

Show raw api
{
    "functions": [
        {
            "name": "untagKiller",
            "desc": "Removes all killer tags",
            "params": [
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 22,
                "path": "src/humanoidkillerutils/src/Shared/HumanoidKillerUtils.lua"
            }
        },
        {
            "name": "tagKiller",
            "desc": "Tags the killer with a source.\n\n:::tip\nBe sure to tag the killer before applying damage.\n:::",
            "params": [
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                },
                {
                    "name": "attacker",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 40,
                "path": "src/humanoidkillerutils/src/Shared/HumanoidKillerUtils.lua"
            }
        },
        {
            "name": "getKillerHumanoidOfHumanoid",
            "desc": "Killer can either be a humanoid or a player (which we'll grab the humanoid)",
            "params": [
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Humanoid?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 62,
                "path": "src/humanoidkillerutils/src/Shared/HumanoidKillerUtils.lua"
            }
        },
        {
            "name": "getPlayerKillerOfHumanoid",
            "desc": "Killer must be a player",
            "params": [
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Player?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 101,
                "path": "src/humanoidkillerutils/src/Shared/HumanoidKillerUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "HumanoidKillerUtils",
    "desc": "Tags and retrieves killer. This is the old API surface to register KOs\nin Roblox, and many legacy systems still use the creator tag. The contract\nis that an object value pointing to the killer will be put in the humanoid, and\nif it exists when the humanoid dies, then the killer is registered.",
    "source": {
        "line": 9,
        "path": "src/humanoidkillerutils/src/Shared/HumanoidKillerUtils.lua"
    }
}