Skip to main content

SkillBase

The base class for all skills. Contains methods that are shared between all skills.

Functions

Destroy

SkillBase:Destroy(Flag"NoReplicate"?) → ()

Destroys the skill, cleaning up all objects and connections. Has a flag to prevent replication of the destruction to the client.

Add

SkillBase:Add(
ObjectInstance | {
[any]any,
Destroy() → ()
} | RBXScriptConnection | () → (),
Methodstring?,
Indexany?
) → ()

Adds an object to the skill's janitor. This will automatically clean up the object when the skill is destroyed. The object can be an instance, a signal, or a function. If the object is a signal, the janitor will disconnect the signal when the skill is destroyed. An optional second argument can be passed to specify the method to call on the object when the skill is destroyed. Example: Skill:Add(Signal, "Disconnect")

Clone

SkillBase:Clone(ObjectInstance) → ()

Clones an object and adds it to the skill's janitor.

PlaySFX

SkillBase:PlaySFX(
SoundSound,
ParentInstance
) → ()

Plays a sound and adds it to the skill's janitor.

Finalize

This item only works when running on the server. Server
SkillBase:Finalize() → ()

Finalizes the skill, and sets the users state back to Idling. Calling this method will start the cooldown and allow the skill to be used again. Any clients that are using the skill will also receive the Finalize call.

UpdateServerState

This item only works when running on the client. Client
SkillBase:UpdateServerState(
StateActionstring,
...any
) → ()

Sends a request to the server to update the skill's state. Received by the Skill:OnStateUpdate method.

Finalize

This item only works when running on the client. Client
SkillBase:Finalize() → ()

Finalizes the skill, and allows the skill to be used again. The client will be free to perform other actions.

Show raw api
{
    "functions": [
        {
            "name": "Destroy",
            "desc": "Destroys the skill, cleaning up all objects and connections.\nHas a flag to prevent replication of the destruction to the client.",
            "params": [
                {
                    "name": "Flag",
                    "desc": "",
                    "lua_type": "\"NoReplicate\"?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 18,
                "path": "src/ReplicatedStorage/Modules/DataStructures/SkillBase.lua"
            }
        },
        {
            "name": "Add",
            "desc": "Adds an object to the skill's janitor. This will automatically clean up the object when the skill is destroyed.\nThe object can be an instance, a signal, or a function. If the object is a signal, the janitor will disconnect the signal when the skill is destroyed.\nAn optional second argument can be passed to specify the method to call on the object when the skill is destroyed.\nExample: `Skill:Add(Signal, \"Disconnect\")`",
            "params": [
                {
                    "name": "Object",
                    "desc": "",
                    "lua_type": "Instance | { [any]: any, Destroy: () -> () } | RBXScriptConnection | () -> ()"
                },
                {
                    "name": "Method",
                    "desc": "",
                    "lua_type": "string?"
                },
                {
                    "name": "Index",
                    "desc": "",
                    "lua_type": "any?\n"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 40,
                "path": "src/ReplicatedStorage/Modules/DataStructures/SkillBase.lua"
            }
        },
        {
            "name": "Clone",
            "desc": "Clones an object and adds it to the skill's janitor.",
            "params": [
                {
                    "name": "Object",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 69,
                "path": "src/ReplicatedStorage/Modules/DataStructures/SkillBase.lua"
            }
        },
        {
            "name": "PlaySFX",
            "desc": "Plays a sound and adds it to the skill's janitor.",
            "params": [
                {
                    "name": "Sound",
                    "desc": "",
                    "lua_type": "Sound"
                },
                {
                    "name": "Parent",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 74,
                "path": "src/ReplicatedStorage/Modules/DataStructures/SkillBase.lua"
            }
        },
        {
            "name": "Finalize",
            "desc": "Finalizes the skill, and sets the users state back to `Idling`. Calling this method will start the cooldown and allow the skill to be used again.\nAny clients that are using the skill will also receive the `Finalize` call.\n\t",
            "params": [],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 115,
                "path": "src/ReplicatedStorage/Modules/DataStructures/SkillBase.lua"
            }
        },
        {
            "name": "UpdateServerState",
            "desc": "Sends a request to the server to update the skill's state. Received by the `Skill:OnStateUpdate` method.\n\t",
            "params": [
                {
                    "name": "StateAction",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 130,
                "path": "src/ReplicatedStorage/Modules/DataStructures/SkillBase.lua"
            }
        },
        {
            "name": "Finalize",
            "desc": "Finalizes the skill, and allows the skill to be used again. The client will be free to perform other actions.\n\t",
            "params": [],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 138,
                "path": "src/ReplicatedStorage/Modules/DataStructures/SkillBase.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "SkillBase",
    "desc": "The base class for all skills. Contains methods that are shared between all skills.",
    "source": {
        "line": 13,
        "path": "src/ReplicatedStorage/Modules/DataStructures/SkillBase.lua"
    }
}