Progress

🛠 Client API Reference

The primary function to initiate a progress bar.

exports['ak47_lib']:StartProgress(data, onFinish, onCancel)
-- or
Lib47.StartProgress(data, onFinish, onCancel)

Parameters

Parameter

Type

Description

data

table

Configuration for the progress bar (see Data Objectarrow-up-right).

onFinish

function

(Optional) Callback triggered when the progress bar completes.

onCancel

function

(Optional) Callback triggered if the action is cancelled (e.g., by pressing 'X').


📦 Data Object

The data table accepts the following properties:

Basic Configuration

  • duration (number): Time in milliseconds. Default: 3000.

  • label (string): Text displayed on the UI. Default: 'Progress'.

  • type (string): The visual style (see Visual Stylesarrow-up-right). Default: 'capsule'.

  • canCancel (boolean): Allows the player to cancel by pressing X.

Logic & Restrictions

  • useWhileDead (boolean): If true, bar won't cancel on death.

  • allowSwimming (boolean): If false, bar cancels when entering water.

  • allowFalling (boolean): If false, bar cancels if the player falls.

  • allowRagdoll (boolean): If false, bar cancels if player is knocked over.

Animation (anim)

A sub-table to define player animations:

  • dict: Animation dictionary.

  • clip: Animation clip.

  • flag: Animation flag (Default: 49).

  • scenario: (Alternative) Name of a world scenario (e.g., WORLD_HUMAN_WELDING).

Prop Attachment (prop)

Attach an object to the player during the action:

  • model: Model name or hash.

  • bone: Bone index (Default: 60309 - Right Hand).

  • pos: vector3(x, y, z) offset.

  • rot: vector3(x, y, z) rotation.

Controls (disable)

  • move: Disables WASD and jumping.

  • mouse: Disables camera movement.

  • combat: Disables shooting and aiming.

  • car: Disables vehicle controls.

  • sprint: Disables sprinting only.


🎨 Visual Styles

You can change the appearance of the progress bar by setting the type field in the data object.

Type

Description

capsule

minimal

segments

pulse

radial-smooth

radial-orbit

radial-ticks

radial-dashed


📝 Usage Example

Basic Usage

Advanced Usage (Animation + Prop + Movement Disable)

Last updated