Skip to main content

ValueBaseUtils

Provides utilities for working with ValueBase objects, like IntValue or ObjectValue in Roblox.

Functions

isValueBase

ValueBaseUtils.isValueBase(instanceInstance) → boolean

Returns true if the value is a ValueBase instance

getValueBaseType

ValueBaseUtils.getValueBaseType(valueBaseClassNamestring) → string?

Gets the lua type for the given class name

getClassNameFromType

ValueBaseUtils.getClassNameFromType(luaTypestring) → string?

Gets class type for the given lua type

getOrCreateValue

ValueBaseUtils.getOrCreateValue(
parentInstance,
instanceTypestring,
namestring,
defaultValueany?
) → Instance

Initializes the value as needed

setValue

ValueBaseUtils.setValue(
parentInstance,
instanceTypestring,
namestring,
valueany
) → any

Sets the value for the parent

getValue

ValueBaseUtils.getValue(
parentInstance,
instanceTypestring,
namestring,
defaultany?
) → any

Gets the value in the children

createGetSet

ValueBaseUtils.createGetSet(
instanceTypestring,
namestring
) → (
function,
function,
function
)

Gets a getter, setter, and initializer for the instance type and name.

Show raw api
{
    "functions": [
        {
            "name": "isValueBase",
            "desc": "Returns true if the value is a ValueBase instance",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 42,
                "path": "src/valuebaseutils/src/Shared/ValueBaseUtils.lua"
            }
        },
        {
            "name": "getValueBaseType",
            "desc": "Gets the lua type for the given class name",
            "params": [
                {
                    "name": "valueBaseClassName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 52,
                "path": "src/valuebaseutils/src/Shared/ValueBaseUtils.lua"
            }
        },
        {
            "name": "getClassNameFromType",
            "desc": "Gets class type for the given lua type",
            "params": [
                {
                    "name": "luaType",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 62,
                "path": "src/valuebaseutils/src/Shared/ValueBaseUtils.lua"
            }
        },
        {
            "name": "getOrCreateValue",
            "desc": "Initializes the value as needed",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "instanceType",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "defaultValue",
                    "desc": "",
                    "lua_type": "any?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 75,
                "path": "src/valuebaseutils/src/Shared/ValueBaseUtils.lua"
            }
        },
        {
            "name": "setValue",
            "desc": "Sets the value for the parent",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "instanceType",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 107,
                "path": "src/valuebaseutils/src/Shared/ValueBaseUtils.lua"
            }
        },
        {
            "name": "getValue",
            "desc": "Gets the value in the children",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "instanceType",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "default",
                    "desc": "",
                    "lua_type": "any?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 137,
                "path": "src/valuebaseutils/src/Shared/ValueBaseUtils.lua"
            }
        },
        {
            "name": "createGetSet",
            "desc": "Gets a getter, setter, and initializer for the instance type and name.",
            "params": [
                {
                    "name": "instanceType",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "function"
                },
                {
                    "desc": "",
                    "lua_type": "function"
                },
                {
                    "desc": "",
                    "lua_type": "function"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 165,
                "path": "src/valuebaseutils/src/Shared/ValueBaseUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ValueBaseUtils",
    "desc": "Provides utilities for working with ValueBase objects, like [IntValue] or [ObjectValue] in Roblox.",
    "source": {
        "line": 6,
        "path": "src/valuebaseutils/src/Shared/ValueBaseUtils.lua"
    }
}