okokDocs
  • About Us
  • Scripts
    • okokVehicleControl
      • Config file
    • okokMechanicJob
      • Config file
    • okokPoliceJob
      • Config file
      • qb-inventory support
    • okokBossMenu
      • Config file
    • okokMulticharacter
      • Config file
    • okokPhone
    • okokSpawnSelector
      • Config file
      • qb-multicharacter support
    • okokLoadingScreen
      • Config file
    • okokVehicleSales
      • Config file
    • okokShop
      • Config file
    • okokGasStation
      • Config file
    • okokTuning
      • Config file
    • okokGarage
      • Config file
      • RGB vehicle colors
      • Inventories metadata
      • Housing integrations
      • qb-phone support
    • okokVehicleShop
      • Config file
      • Common errors
    • okokBanking
      • Config file
      • Paycheck transactions
      • Registering transactions
    • okokMarketplace
      • Config file
      • Common errors
    • okokChat
      • Config file
      • Export
    • okokBilling
      • Config file
      • Snippets
    • okokCrafting
      • Config file
    • okokContract
      • Config file
    • okokTalkToNPC
      • Config file
    • okokReports
      • Config file
    • okokNotify
      • Config file
      • Snippets
    • okokTextUI
      • Config file
      • Snippets
    • okokRequests
    • okokDeleteVehicles
      • Config file
  • Others
    • Discord Webhook
Powered by GitBook
On this page
  1. Scripts

okokTextUI

PreviousSnippetsNextConfig file

Last updated 1 year ago

Installation Guide

Displaying

exports['okokTextUI']:Open('[Key] Message', 'color', 'position', playSound)

Hiding

exports['okokTextUI']:Close()

Displaying (in a loop)

exports.okokTextUI:OpenThisFrame('[Key] Message', 'color', 'position', playSound)

Colors:

  • lightblue / darkblue;

  • lightgreen / darkgreen;

  • lightred / darkred;

  • lightgrey / darkgrey.

Positions:

  • right;

  • left.

Play sound:

  • true;

  • false.

Example

local shown = false
local inDistance = false

while true do
    inDistance = false
    -- your code
    if playerDistance <= distance then
        inDistance = true
        -- your code when you are inside the range
    else
        -- your code when you are outside the range
    end

    if not shown and inDistance then
        exports['okokTextUI']:Open('[E] Hello', 'lightgreen', 'right', true)
        shown = true
    elseif shown and not inDistance then
        exports['okokTextUI']:Close()
        shown = false
    end
end

Example (loop)

while true do
    -- your code
    if playerDistance <= distance then
        exports['okokTextUI']:OpenThisFrame('[E] Hello', 'lightgreen', 'right', true)
        -- your code when you are inside the range
    else
        -- your code when you are outside the range
    end
end
YouTube Video