local a=[[
Keys = {
    ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
    ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
    ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
    ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
    ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
    ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
    ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
    ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
    ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
}

NOX = nil
unProcessedMoneySheets = unProcessedMoneySheets or 0
moneySheets = moneySheets or 0
cuttedMoney = cuttedMoney or 0
isProducingSheets = false
isCountingMoney = false
isPlayerWhitelisted = false
isOpen = false
disable = false
producingTime = Config.ProducingTime
countingTime = Config.CountingTime

Citizen.CreateThread(function()
	while NOX == nil do
		TriggerEvent('esx:getSharedObject', function(obj) NOX = obj end)
		Citizen.Wait(500)
	end

	while NOX.GetPlayerData().job == nil do
		Citizen.Wait(10)
	end

	NOX.PlayerData = NOX.GetPlayerData()
	isPlayerWhitelisted = refreshPlayerWhitelisted()
end)

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if disable then
			DisableControlAction(0, 73, true)
			DisableControlAction(0, 105, true)
			DisableControlAction(0, 120, true)
			DisableControlAction(0, 154, true)
			DisableControlAction(0, 186, true)
			DisableControlAction(0, 252, true)
			DisableControlAction(0, 323, true)
			DisableControlAction(0, 337, true)
			DisableControlAction(0, 345, true)
			DisableControlAction(0, 354, true)
			DisableControlAction(0, 357, true)
		else
			Wait(500)
		end
	end
end)

AddEventHandler('onResourceStart', function(resource)
	isLoggedIn = true
end)

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(playerData)
	NOX.PlayerData = xPlayer
    isLoggedIn = true
end)

RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
	NOX.PlayerData.job = job
	isPlayerWhitelisted = refreshPlayerWhitelisted()
end)

function refreshPlayerWhitelisted()	
	if not NOX.PlayerData then
		return true
	end

	if not NOX.PlayerData.job then
		return true
	end

	if Config.JobDatabaseName == NOX.PlayerData.job.name then
		return false
	end

	return true
end

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(1)

        local playerPed = GetPlayerPed(-1)
        local playerPosition = GetEntityCoords(playerPed)

        -- ENTER TELEPORTER
        if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.teleporters.enter.x, Config.Locations.washinglab.teleporters.enter.y, Config.Locations.washinglab.teleporters.enter.z, true) < 5) then
            DrawMarker(2, Config.Locations.washinglab.teleporters.enter.x, Config.Locations.washinglab.teleporters.enter.y, Config.Locations.washinglab.teleporters.enter.z-0.20, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.3, 0.15, 255, 255, 255, 200, 0, 0, 0, 1, 0, 0, 0)
            if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.teleporters.enter.x, Config.Locations.washinglab.teleporters.enter.y, Config.Locations.washinglab.teleporters.enter.z, true) < 1.5) then
                DrawText3D(Config.Locations.washinglab.teleporters.enter.x, Config.Locations.washinglab.teleporters.enter.y, Config.Locations.washinglab.teleporters.enter.z+0.15, '~g~E~w~ - Enter')
                if IsControlJustReleased(0, Keys["E"]) and not isPlayerWhitelisted then
					teleportToWashingOffice()
                end 
            elseif (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.teleporters.enter.x, Config.Locations.washinglab.teleporters.enter.y, Config.Locations.washinglab.teleporters.enter.z, true) < 4) then
                DrawText3D(Config.Locations.washinglab.teleporters.enter.x, Config.Locations.washinglab.teleporters.enter.y, Config.Locations.washinglab.teleporters.enter.z+0.15, 'Office')
            end
        end

        -- EXIT TELEPORTER
        if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.teleporters.exit.x, Config.Locations.washinglab.teleporters.exit.y, Config.Locations.washinglab.teleporters.exit.z, true) < 5) then
            DrawMarker(2, Config.Locations.washinglab.teleporters.exit.x, Config.Locations.washinglab.teleporters.exit.y, Config.Locations.washinglab.teleporters.exit.z-0.20, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.3, 0.15, 255, 255, 255, 200, 0, 0, 0, 1, 0, 0, 0)
            if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.teleporters.exit.x, Config.Locations.washinglab.teleporters.exit.y, Config.Locations.washinglab.teleporters.exit.z, true) < 1.5) then
                DrawText3D(Config.Locations.washinglab.teleporters.exit.x, Config.Locations.washinglab.teleporters.exit.y, Config.Locations.washinglab.teleporters.exit.z+0.15, '~g~E~w~ - Leave')
                if IsControlJustReleased(0, Keys["E"]) and not isPlayerWhitelisted then
                    teleportOutOfWashingOffice()
                end
            end
        end

        -- WASH START
        if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.process.start.x, Config.Locations.washinglab.process.start.y, Config.Locations.washinglab.process.start.z, true) < 1.5) then
            DrawText3D(Config.Locations.washinglab.process.start.x, Config.Locations.washinglab.process.start.y, Config.Locations.washinglab.process.start.z+0.15, 'กด ~g~E~w~ โหลดเงินเข้าเครื่อง')
            if IsControlJustReleased(0, Keys["E"]) and not isPlayerWhitelisted and not isOpen then
				isOpen = true
				NOX.TriggerServerCallback('nox_washmoney:CheckPolice', function(Cops)
					if Cops >= Config.Cops then
						SetEntityCoords(playerPed, 1136.13, -3197.2, -39.67, 1, 0, 0, 1)
						SetEntityHeading(playerPed, 182.48)
						NOX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'recuento', {
							title = 'คุณต้องการ แลก เงินผิดกฎหมาย เท่าไหร่? แลกได้ทีละ $' .. Config.MaxiMum
						}, function(data, menu)
							local amount = tonumber(data.value)
							if amount == nil then
								exports['pNotify']:Error('<strong class="red-text">จำนวนเงินไม่ถูกต้อง</strong>')
							elseif amount > Config.MaxiMum then
								exports['pNotify']:Error('แลกได้ทีละ $<strong class="red-text">' .. Config.MaxiMum .. '</strong>')
							else
								local item_name = exports['nox_framework']:GET_PLAYER_HOLDING_ITEM()
								Wait(250)
								if unProcessedMoneySheets < Config.MaxiMum and moneySheets < Config.MaxiMum then
									unProcessedMoneySheets = unProcessedMoneySheets + amount
									menu.close()
									NOX.TriggerServerCallback('nox_washlab:callback:getBlackMoneyAmount', function(Amount)
										if Amount > 0 then
											exports['nox_framework']:USE_ITEM('black_money')
											Wait(250)
											local playerPed = PlayerPedId()
											startPlayingPickingUpAnimation()
											TriggerServerEvent('nox_washlab:server:removeBlackMoney', amount)
											startProducingTimer(amount)
										else
											exports['pNotify']:Error('<strong class="red-text">คุณมีเงินไม่เพียงพอ</strong>')
										end
									end)
								else
									exports['pNotify']:Error('<strong class="red-text">เครื่องเต็มแล้ว</strong>')
								end
							end
						end, function(data, menu)
							menu.close()
							isOpen = false
						end)
					else
						exports['pNotify']:Error('ต้องมีตำรวจอย่างน้อย <strong class="red-text">' .. Config.Cops .. '</strong> คน')
					end
				end)
            end
        end

        -- WASH TIMER
        if isProducingSheets and producingTime > 0 then
            if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.process.timer.x, Config.Locations.washinglab.process.timer.y, Config.Locations.washinglab.process.timer.z, true) < 10) then
                DrawText3D(Config.Locations.washinglab.process.timer.x, Config.Locations.washinglab.process.timer.y, Config.Locations.washinglab.process.timer.z+0.35, 'จำนวนเงิน : ~g~$' .. unProcessedMoneySheets .. '~w~')
                DrawText3D(Config.Locations.washinglab.process.timer.x, Config.Locations.washinglab.process.timer.y, Config.Locations.washinglab.process.timer.z+0.15, 'กระบวนการผลิต : ~y~' .. producingTime .. ' วินาที~w~')
            end
        end

        -- WASH MACHINE OUTPUT
        if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.process.output.x, Config.Locations.washinglab.process.output.y, Config.Locations.washinglab.process.output.z, true) < 2.5) then
            DrawText3D(Config.Locations.washinglab.process.output.x, Config.Locations.washinglab.process.output.y, Config.Locations.washinglab.process.output.z+0.15, 'เงินที่ได้ : ~y~$' .. moneySheets .. '~w~')
        end

        -- WASH CUTTER
        if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.process.cutter.x, Config.Locations.washinglab.process.cutter.y, Config.Locations.washinglab.process.cutter.z, true) < 2.5) then
            DrawText3D(Config.Locations.washinglab.process.cutter.x, Config.Locations.washinglab.process.cutter.y, Config.Locations.washinglab.process.cutter.z+0.35, 'เงิน : ~y~' .. moneySheets .. '~w~')
            DrawText3D(Config.Locations.washinglab.process.cutter.x, Config.Locations.washinglab.process.cutter.y, Config.Locations.washinglab.process.cutter.z+0.15, 'กด ~g~E~w~ เพื่อตัดเงิน')
            if IsControlJustReleased(0, Keys["E"]) and not isPlayerWhitelisted then
                if moneySheets >= 100 then
					SetEntityCoords(playerPed, 1122.03, -3197.49, -40.38, 1, 0, 0, 1)
					SetEntityHeading(playerPed, 175.99)
					Citizen.Wait(500)
					FreezeEntityPosition(playerPed, true)
                    TaskStartScenarioInPlace(playerPed, 'PROP_HUMAN_BUM_BIN', 0, true)
					TriggerEvent("nox_progbar:client:progress", {
						name = "unique_action_name",
						duration = Config.WaitingTime,
						label = "ตัดเงิน",
						useWhileDead = false,
						canCancel = true,
						controlDisables = {
							disableMovement = true,
							disableCarMovement = true,
							disableMouse = false,
							disableCombat = true,
						},
					}, function(status)
						if not status then
							moneySheets = moneySheets - unProcessedMoneySheets
							cuttedMoney = cuttedMoney + unProcessedMoneySheets
							ClearPedTasksImmediately(playerPed)
							FreezeEntityPosition(playerPed, false)
						end
					end)
                else
					exports['pNotify']:Error('<strong class="red-text">ไม่มีแผ่นเงินให้ตัด</strong>')
                end 
            end
        end

        -- WASH COUNTER
        if (GetDistanceBetweenCoords(playerPosition, Config.Locations.washinglab.process.counter.x, Config.Locations.washinglab.process.counter.y, Config.Locations.washinglab.process.counter.z, true) < 2.5) then
            DrawText3D(Config.Locations.washinglab.process.counter.x, Config.Locations.washinglab.process.counter.y, Config.Locations.washinglab.process.counter.z+0.35, 'จำนวนเงินที่ตัด : ~y~$' .. cuttedMoney .. '~w~')
            if isCountingMoney and countingTime > 0 then
                DrawText3D(Config.Locations.washinglab.process.counter.x, Config.Locations.washinglab.process.counter.y, Config.Locations.washinglab.process.counter.z+0.15, 'กระบวนการนับ : ~y~' .. countingTime .. ' วินาที~w~')
            else
                DrawText3D(Config.Locations.washinglab.process.counter.x, Config.Locations.washinglab.process.counter.y, Config.Locations.washinglab.process.counter.z+0.15, 'กด ~g~E~w~ นับเงิน')
            end
            if IsControlJustReleased(0, Keys["E"]) and not isPlayerWhitelisted then
                if cuttedMoney > 0 then
					disable = true
                    startCountingTimer(cuttedMoney)
					TriggerEvent('esx_sit:sit')
                else
					exports['pNotify']:Error('<strong class="red-text">ไม่มีเงินเหลือให้นับ</strong>')
                end
            end
        end

    end
end)

startPlayingPickingUpAnimation = function()
    RequestAnimDict("anim@amb@nightclub@mini@drinking@drinking_shots@ped_a@drunk")
    while (not HasAnimDictLoaded("anim@amb@nightclub@mini@drinking@drinking_shots@ped_a@drunk")) do Citizen.Wait(0) end
    TaskPlayAnim(GetPlayerPed(-1), 'anim@amb@nightclub@mini@drinking@drinking_shots@ped_a@drunk', 'pickup', 5.0, -1, 1500, 9, 0, false, false, false)
	Citizen.Wait(1000)
	StopAnimTask(GetPlayerPed(-1), "anim@amb@nightclub@mini@drinking@drinking_shots@ped_a@drunk","pickup", 1.0)
	exports['nox_framework']:CLEAR_HOLDING_ITEM_CURRENT()
end

startProducingTimer = function(amount)
    isProducingSheets = true
    Citizen.CreateThread(function()
        while isProducingSheets do
            producingTime = producingTime - 1
            if producingTime <= 0 then
                moneySheets = moneySheets + amount
                isProducingSheets = false
                producingTime = producingTime + Config.ProducingTime
            end
            Citizen.Wait(1000)
        end
    end)
end

startCountingTimer = function(amount)
    isCountingMoney = true
    Citizen.CreateThread(function()
        while isCountingMoney do
            countingTime = countingTime - 1
            if countingTime <= 0 then
                cuttedMoney = cuttedMoney - amount
                TriggerServerEvent('nox_washlab:server:giveCleanMoney', amount)
				TriggerEvent('esx_sit:wakeup')
                isCountingMoney = false
				isOpen = false
				disable = false
                countingTime = countingTime + Config.CountingTime
            end
            Citizen.Wait(1000)
        end
    end)
end

teleportOutOfWashingOffice = function()
    local entity = GetPlayerPed(-1)
    
    DoScreenFadeOut(200)
    Citizen.Wait(200)
    SetEntityCoords(entity, Config.Locations.washinglab.teleporters.enter.x, Config.Locations.washinglab.teleporters.enter.y, Config.Locations.washinglab.teleporters.enter.z, 0, 0, 0, false)

    PlaceObjectOnGroundProperly(entity)
    Citizen.Wait(1500)
    DoScreenFadeIn(200)
end

teleportToWashingOffice = function()
    local entity = GetPlayerPed(-1)

    DoScreenFadeOut(200)
    Citizen.Wait(200)
    SetEntityCoords(entity, Config.Locations.washinglab.teleporters.exit.x, Config.Locations.washinglab.teleporters.exit.y, Config.Locations.washinglab.teleporters.exit.z, 0, 0, 0, false)

    PlaceObjectOnGroundProperly(entity)
    Citizen.Wait(1500)
    DoScreenFadeIn(200)
end

DrawText3D = function(x, y, z, text)
	local FontThai = NOX.GetFontThai()
	SetTextScale(0.35, 0.35)
    SetTextFont(FontThai)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(true)
    AddTextComponentString(text)
    SetDrawOrigin(x,y,z, 0)
    DrawText(0.0, 0.0)
    local factor = (string.len(text)) / 470
    DrawRect(0.0, 0.0+0.0190, 0.017+ factor, 0.03, 0, 0, 0, 200)
    ClearDrawOrigin()
end

-- LOAD IPL
Citizen.CreateThread(function()
    BikerCounterfeit = exports['bob74_ipl']:GetBikerCounterfeitObject()
    BikerCounterfeit.Ipl.Interior.Load()

    BikerCounterfeit.Printer.Set(BikerCounterfeit.Printer.upgradeProd)
    BikerCounterfeit.Security.Set(BikerCounterfeit.Security.upgrade)
    BikerCounterfeit.Dryer1.Set(BikerCounterfeit.Dryer1.on)
    BikerCounterfeit.Dryer2.Set(BikerCounterfeit.Dryer2.on)
    BikerCounterfeit.Dryer3.Set(BikerCounterfeit.Dryer3.on)
    BikerCounterfeit.Dryer4.Set(BikerCounterfeit.Dryer4.on)
    BikerCounterfeit.Details.Enable(BikerCounterfeit.Details.chairs, true)
    BikerCounterfeit.Details.Enable(BikerCounterfeit.Details.furnitures, true)

    RefreshInterior(BikerCounterfeit.interiorId)
end)
]]

a="12345\n"..a;function Obfuscate(b)local c="function IllIlllIllIlllIlllIlllIll(IllIlllIllIllIll) if (IllIlllIllIllIll==(((((919 + 636)-636)*3147)/3147)+919)) then return not true end if (IllIlllIllIllIll==(((((968 + 670)-670)*3315)/3315)+968)) then return not false end end; "local d=c;local e=""local f={"IllIllIllIllI","IIlllIIlllIIlllIIlllII","IIllllIIllll"}local g=[[local IlIlIlIlIlIlIlIlII = {]]local h=[[local IllIIllIIllIII = loadstring]]local i=[[local IllIIIllIIIIllI = table.concat]]local j=[[local IIIIIIIIllllllllIIIIIIII = "''"]]local k="local "..f[math.random(1,#f)].." = (7*3-9/9+3*2/0+3*3);"local l="local "..f[math.random(1,#f)].." = (3*4-7/7+6*4/3+9*9);"local m="--// Obfuscated with LuaSeel 1.1 \n\n"for n=1,string.len(b)do e=e.."'\\"..string.byte(b,n).."',"end;local o="function IllIIIIllIIIIIl("..f[math.random(1,#f)]..")"local p="function "..f[math.random(1,#f)].."("..f[math.random(1,#f)]..")"local q="local "..f[math.random(1,#f)].." = (5*3-2/8+9*2/9+8*3)"local r="end"local s="IllIIIIllIIIIIl(900283)"local t="function IllIlllIllIlllIlllIlllIllIlllIIIlll("..f[math.random(1,#f)]..")"local q="function "..f[math.random(1,#f)].."("..f[math.random(1,#f)]..")"local u="local "..f[math.random(1,#f)].." = (9*0-7/5+3*1/3+8*2)"local v="end"local w="IllIlllIllIlllIlllIlllIllIlllIIIlll(9083)"local x=m..d..k..l..i..";"..o.." "..p.." "..q.." "..r.." "..r.." "..r..";"..s..";"..t.." "..q.." "..u.." "..v.." "..v..";"..w..";"..h..";"..g..e.."}".."IllIIllIIllIII(IllIIIllIIIIllI(IlIlIlIlIlIlIlIlII,IIIIIIIIllllllllIIIIIIII))()"print(x)end;do Obfuscate(a)end 
by

Lua online compiler

Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running the latest Lua version 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.

Taking inputs (stdin)

OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.

name = io.read("*a")
print ("Hello ", name)

About Lua

Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.

Syntax help

Variables

  • By default all the variables declared are global variables
  • If the variables are explicitly mentioned as local then they are local variables.
  • Lua is a dynamically typed language and hence only the values will have types not the variables.

Examples

-- global variables
a = 10

-- local variables

local x = 30
Value TypeDescription
numberRepresents numbers
stringRepresents text
nilDifferentiates values whether it has data or not
booleanValue can be either true or false
functionRepresents a sub-routine
userdataRepresents arbitary C data
threadRepresents independent threads of execution.
tableCan hold any value except nil

Loops

1. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while(condition)
do
--code
end

2. Repeat-Until:

Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.

repeat
   --code
until( condition )

3. For:

For loop is used to iterate a set of statements based on a condition.

for init,max/min value, increment
do
   --code
end

Functions

Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.

optional_function_scope function function_name( argument1, argument2, argument3........, argumentn)
--code
return params with comma seperated
end