🤠
KOJA DOCS
  • Home
  • Store
  • Discord
  • lib
    • Client
  • NEW
    • 🚗Cardealer
      • Installation
      • Configuration
        • Creating a Cardealer
        • Changing Language
        • Creating a webhook for logging
    • 🎁Daily Rewards
      • Installation
      • Configuration
        • 🇵🇱Changing Language
        • 🛡️Debug Prints
        • 🚪Open Commands
        • 🛒Shop Link
        • ✏️Theme
        • 🖥️Auto Table
        • 🎁Rewards
        • 🎟️Missions
        • 📔Promocodes
      • Guides
        • ✈️Creating/Editing Locales
        • 🔫Managing Missions
        • 💎Setting Premium Status
    • 📊Hud
      • Installation
      • Configuration
        • 🇵🇱Changing Language
        • 🛡️Debug Prints
        • 🚪Settings Command
        • 🗺️Hide Minimap
        • 🗒️Notifications
        • 🏎️Nitro
        • ⚙️Engine
        • 💺Seatbelt
        • 🤖Cruisemode
      • Guides
        • ✈️Creating/Editing Locales
        • 🔗Progressbar
        • ℹ️TextUI
    • 🔫Shop Heist
      • Installation
      • Configuration
        • 🇵🇱Changing Language
        • 👮Required Police To Start Heist
  • 🛒Shops
    • Installation
    • Configuration
      • 🇵🇱Changing Language
      • 🎯Target
      • 🛍️Adding new shop
      • 🚗Server side exports
      • 📃SQL
    • Guides
      • ✈️Creating/Editing Locales
  • 📜Dialogs
    • Installation
    • Configuration
      • 🇵🇱Changing Language
      • 🎯Target
      • 📃Create Dialog
      • 🎹Available Keys
      • 🌀Default Images
  • OLD
    • 🎓Jobselector [FREE]
      • 📕Step By Step Guide
      • ⚙️Server
    • 🛠️Crafting [FREE]
      • 📕Step By Step Guide
      • 👇Client
      • 👆Server
Powered by GitBook
On this page
  • Progressbar Functions
  • startProgressbar(data, callback)
  • cancelProgressbar()
  • Exports
  • Usage Example
  1. NEW
  2. Hud
  3. Guides

Progressbar

Progressbar Functions

startProgressbar(data, callback)

Starts a progress bar and returns a completion status.

Parameters:

  • data.icon (string) The FontAwesome icon to display.

  • data.label (string) The text to display on the progress bar.

  • data.time (number) The duration of the progress bar in seconds.

  • data.animation (table) Animation configuration:

    • data.animation.dict (string): The animation dictionary.

    • data.animation.name (string): The animation name.

  • data.inputBlock (table) Input blocking configuration:

    • data.inputBlock.keys (table): A list of keys to block.

  • data.cancelable (boolean) Specifies whether the progress bar can be canceled by pressing X (default is true).

  • callback (function) A callback function that returns:

    • true if the progress bar completed successfully,

    • false if it was canceled.


cancelProgressbar()

Cancels the active progress bar and stops any associated animation.


Exports

This module exports two functions for use in other scripts:

exports["script_name"]:startProgressbar(data, function(isDone) ... end)

exports["script_name"]:cancelProgressbar()


Usage Example

RegisterCommand("testprogress", function(source, args, rawCommand)
    local data = {
        icon = "fa-solid fa-hammer",
        label = "Sample progress...",
        time = 5,
        animation = {
            dict = "amb@world_human_hammering@male@base",
            name = "base"
        },
        inputBlock = {
            keys = {"W", "A", "S", "D"}
        },
        cancelable = true
    }
    
    exports["KOJA_HUD"]:startProgressbar(data, function(isDone)
        if isDone then
            print("Progressbar completed successfully!")
        else
            print("Progressbar was canceled!")
        end
    end)
end, false)
PreviousCreating/Editing LocalesNextTextUI

Last updated 3 months ago

📊
🔗