Native Bars

Create

Creates a new Bar object and returns its.

Bars:Create(index)
  • index: number | nil

example:

local newBar = Bars:Create(1)

ProgressBar

Triggers a progressbar. Can only be used with a created object.

Bars:ProgressBar(time)
  • time: number

example:

newBar:ProgressBar(60)

IsReady

Returns if the progressbar has been completed.

Bars:IsReady()

example:

repeat Wait(0) until newBar:IsReady()

TextBar

Renders a simple text bar.

Bars:TextBar(text)
  • text: string

example:

while true do
    Wait(0)
    newBar:TextBar('This is a Text')
end

InfoBar

Renders an info bar with an title and text content.

Bars:InfoBar(titleText, text)
  • titleText: string
  • text: string

example:

while true do
    Wait(0)
    newBar:InfoBar('Points:', '2')
end

TimerBar

Renders a GTA:O timer bar.

Bars:TimerBar(label, time, unit)
  • label: string
  • time: number
  • unit: string

example:

local time = 60 
 
CreateThread(function()
    while time >= 0 do
        time -= 1
        Wait(1000)
    end
end)
 
while time >= 0 do
    Wait(0)
    newBar:TimerBar('Time remaining:', time, 'Sek.')
end

PercentBar

Renders a percentbar. Looks like the Progressbar but doesnt update any values.

Bars:PercentBar(label, percent)
  • label: string
  • percent: number

example:

while true do
    Wait(0)
    newBar:PercentBar('Health', 80)
end

ColoredPercentBar

Renders a colored percentbar. Looks like the Progressbar but doesnt update any values.

Bars:ColoredPercentBar(label, percent, r, g, b)
  • label: string
  • percent: number
  • r: number
  • g: number
  • b: number

example:

while true do
    Wait(0)
    newBar:ColoredPercentBar('Health', 80, 255, 255, 255)
end