ATY Scripts Logo
ATY Scripts/Docs/UI Kit/Loading Bar

Loading Bar

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

  • 7000
    The duration (in milliseconds) for the loading bar to complete.
    Type: integer

Animation Dictionary (dict)

  • "mini@sprunk"
    The animation dictionary to be used during the loading sequence.
    Type: string

Animation Name (anim)

  • "plyr_buy_drink_pt1"
    The specific animation to play from the animation dictionary.
    Type: string

Flags

  • 1
    Animation 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

  • 28422
    The 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)

  • vector3(0.0, 0.0, 0.0)
    The rotation offset for the prop relative to the specified bone.
    Type: vector3

Disable Controls

  • false
    Specifies whether player controls should be disabled during the loading bar sequence.
    Type: boolean

Cancel

  • true
    Determines 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)
    
ATY Scripts LogoATY SCRIPTS

Creamos scripts de FiveM altamente optimizados para QBCore y ESX. Máximo rendimiento, código preciso, cero lag.

Unirse a la comunidad

Socio

Socios oficiales de Tebex. Pago seguro e integración con Cfx.re Keymaster.

Legal

Sin afiliación con Rockstar Games, Cfx.re, FiveM ni Take-Two Interactive. Las compras se rigen por los Términos de Servicio de Tebex.

© 2026 ATY SCRIPTS. Todos los derechos reservados.