Skip to main content

QuestBase

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

Functions

Destroy

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

Destroys the quest. Cleans up all objects and connections. If there is a QuestReplication object, it will be destroyed as well.

Add

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

Adds an object to the quest's janitor. This will automatically clean up the object when the quest 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 quest is destroyed. An optional second argument can be passed to specify the method to call on the object when the quest is destroyed. Example: Quest:Add(Signal, "Disconnect")

Clone

QuestBase:Clone(ObjectInstance) → ()

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

PlaySFX

QuestBase:PlaySFX(
SoundSound,
ParentInstance?
) → ()

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

Finalize

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

Finalizes the quest, which will prevent the quest from being updated and allows a new quest to be started. Will automatically send a Finalize event to the client QuestFX.

UpdateServerState

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

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

Finalize

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

Finalizes the quest, which will prevent the quest from being updated and allows a new quest to be started.

Show raw api
{
    "functions": [
        {
            "name": "Destroy",
            "desc": "Destroys the quest. Cleans up all objects and connections. If there is a `QuestReplication` object, it will be destroyed as well.",
            "params": [
                {
                    "name": "Flag",
                    "desc": "",
                    "lua_type": "\"NoReplicate\"?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 16,
                "path": "src/ReplicatedStorage/Modules/DataStructures/QuestBase.lua"
            }
        },
        {
            "name": "Add",
            "desc": "Adds an object to the quest's janitor. This will automatically clean up the object when the quest 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 quest is destroyed.\nAn optional second argument can be passed to specify the method to call on the object when the quest is destroyed.\nExample: `Quest:Add(Signal, \"Disconnect\")`",
            "params": [
                {
                    "name": "Object",
                    "desc": "",
                    "lua_type": "Instance | { [any]: any, Destroy: () -> () } | RBXScriptConnection | () -> ()"
                },
                {
                    "name": "Method",
                    "desc": "",
                    "lua_type": "string?\n"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 34,
                "path": "src/ReplicatedStorage/Modules/DataStructures/QuestBase.lua"
            }
        },
        {
            "name": "Clone",
            "desc": "Clones an object and adds it to the quest's janitor.",
            "params": [
                {
                    "name": "Object",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 52,
                "path": "src/ReplicatedStorage/Modules/DataStructures/QuestBase.lua"
            }
        },
        {
            "name": "PlaySFX",
            "desc": "Plays a sound and adds it to the quest's janitor.",
            "params": [
                {
                    "name": "Sound",
                    "desc": "",
                    "lua_type": "Sound"
                },
                {
                    "name": "Parent",
                    "desc": "",
                    "lua_type": "Instance?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 57,
                "path": "src/ReplicatedStorage/Modules/DataStructures/QuestBase.lua"
            }
        },
        {
            "name": "Finalize",
            "desc": "Finalizes the quest, which will prevent the quest from being updated and allows a new quest to be started. Will automatically send a `Finalize` event to the client QuestFX.\n\t",
            "params": [],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 94,
                "path": "src/ReplicatedStorage/Modules/DataStructures/QuestBase.lua"
            }
        },
        {
            "name": "UpdateServerState",
            "desc": "Sends a request to the server to update the quest's state. Received by the `Quest:OnStateUpdate` method.\n\t",
            "params": [
                {
                    "name": "StateAction",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 108,
                "path": "src/ReplicatedStorage/Modules/DataStructures/QuestBase.lua"
            }
        },
        {
            "name": "Finalize",
            "desc": "Finalizes the quest, which will prevent the quest from being updated and allows a new quest to be started.\n\t",
            "params": [],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 116,
                "path": "src/ReplicatedStorage/Modules/DataStructures/QuestBase.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "QuestBase",
    "desc": "The base class for all quests. Contains methods that are shared between all quests.",
    "source": {
        "line": 12,
        "path": "src/ReplicatedStorage/Modules/DataStructures/QuestBase.lua"
    }
}