Skip to main content

Tween

Custom wrapper for TweenService.

Package Attribute Value
__singleton false
__domain shared

Functions

play

This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. Yields
Tween.play(
objectInstance,
paramsnumber | TweenInfo,
goal{[propertystring]endvalueany}
) → {
TweenTweenBase,
wait() → ()
}

Creates a new tween object and plays it. params is passed in as the tween time if it is a number. Returns a wait method that is equivalent to TweenBase.Completed:Wait().

Show raw api
{
    "functions": [
        {
            "name": "play",
            "desc": "Creates a new tween object and plays it. `params` is passed in as the tween time if it is a `number`. Returns a `wait` method that is equivalent to `TweenBase.Completed:Wait()`.",
            "params": [
                {
                    "name": "object",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "params",
                    "desc": "",
                    "lua_type": "number | TweenInfo"
                },
                {
                    "name": "goal",
                    "desc": "",
                    "lua_type": "{ [property: string]: endvalue: any }"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ Tween: TweenBase, wait: () -> () }"
                }
            ],
            "function_type": "static",
            "yields": true,
            "source": {
                "line": 22,
                "path": "src/essentials/Tween.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Tween",
    "desc": "Custom wrapper for TweenService.\n\n| Package Attribute | Value |\n| --- | --- |\n| __singleton | false |\n| __domain | shared |",
    "source": {
        "line": 45,
        "path": "src/essentials/Tween.lua"
    }
}