Loading Bar
Here is an example of Aty Scripts - UI Kit's loading bar system usage.
Loading Bar Usage Guide
Creating a Loading Bar
To create a loading bar, use the following function:
aty.loading("Purchasing", 7000, {
    dict = "mini@sprunk",
    anim = "plyr_buy_drink_pt1",
    flags = 1,
    duration = 7000,
    prop = "p_amb_coffeecup_01",
    bone = 28422,
    offset = vector3(0.0, 0.0, 0.0),
    rot = vector3(0.0, 0.0, 0.0),
    disableControls = false,
    cancel = true,
}, function(success)
    if success == "ok" then -- Here will be the used when the loading is done.
        aty.sendNotify("Purchased", "You have purchased a drink.", "success", 8000)
    elseif success == "cancelled" then -- Here will be the used when the loading is canceled.
        aty.sendNotify("Purchased", "You have canceled the puchasing.", "error", 8000)
    else -- Here will be the used when the loading is failed or already active.
        aty.sendNotify("Purchased", "You can't do this now!", "error", 8000)
    end
end)Loading Bar Parameters
Title
- "Purchasing"The title of the loading bar, displayed as a notification. Type:- string
Duration
- 7000The duration (in milliseconds) for the loading bar to complete. Type:- integer
Animation Dictionary (dict)
dict)- "mini@sprunk"The animation dictionary to be used during the loading sequence. Type:- string
Animation Name (anim)
anim)- "plyr_buy_drink_pt1"The specific animation to play from the animation dictionary. Type:- string
Flags
- 1Animation behavior flags, controlling playback settings. Type:- integer
Prop
- "p_amb_coffeecup_01"The name of the prop (object) to attach to the character during the animation. Type:- string
Bone
- 28422The bone index to which the prop is attached. Type:- integer
Offset
- vector3(0.0, 0.0, 0.0)The position offset for the prop relative to the specified bone. Type:- vector3
Rotation (rot)
rot)- vector3(0.0, 0.0, 0.0)The rotation offset for the prop relative to the specified bone. Type:- vector3
Disable Controls
- falseSpecifies whether player controls should be disabled during the loading bar sequence. Type:- boolean
Cancel
- trueDetermines whether the player can cancel the loading bar. Type:- boolean
Callback Function
The callback function handles the outcome of the loading bar:
- "ok": Triggered when the loading bar completes successfully.- aty.sendNotify("Purchased", "You have purchased a drink.", "success", 8000)
- "cancelled": Triggered when the loading bar is canceled.- aty.sendNotify("Purchased", "You have canceled the purchasing.", "error", 8000)
- Other: Triggered when the loading bar fails or is already active. - aty.sendNotify("Purchased", "You can't do this now!", "error", 8000)
Last updated