guiProgressBarGetProgress | Multi Theft Auto: Wiki Skip to content

guiProgressBarGetProgress

Client-side
Server-side
Shared

Pair: guiProgressBarSetProgress

This function gets the progress of a progress bar as a percentage.

OOP Syntax Help! I don't understand this!

Syntax

float|false guiProgressBarGetProgress ( ​gui-progressbar theProgressbar )
Required arguments
  • theProgressbar: The progressbar you want to check.

Returns

Returns a float ranging between 0 and 100, false if invalid progressbar element was passed.

  • float|false: progress

Code Examples

client
local progressBar = guiCreateProgressBar(0.3, 0.4, 0.15, 0.03, true)
local label = guiCreateLabel(0.3, 0.38, 0.1, 0.025, 'Progress: 0%', true)
setTimer(function()
local newProgress = (guiProgressBarGetProgress(progressBar) + 1) % 100
guiProgressBarSetProgress(progressBar, newProgress)
guiSetText(label, 'Progress: '..newProgress..'%')
end, 25, 0)

See Also

GUI Functions