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
}

local CurrentAction, CurrentActionMsg, CurrentActionData = nil, '', {}
local IsBusy = false
local disabled = false

RegisterNetEvent('esx_langbam:disablezone')
AddEventHandler('esx_langbam:disablezone', function(status)
	disabled = status
end)

function randomrevive()
  math.randomseed(GetGameTimer())
  return (math.random(1, 100) >= 50)
end

function OpenLangBamActionsMenu()

	ESX.UI.Menu.CloseAll()

	ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_langbam_actions', {
		title    = 'Lang băm',
		align    = 'bottom-right',
		elements = {
			{label = 'Tương tác người chơi', value = 'citizen_interaction'}
		}
	}, function(data, menu)
		if data.current.value == 'citizen_interaction' then
			ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
				title    = 'Tương tác người chơi',
				align    = 'bottom-right',
				elements = {
					{label = 'Hồi sinh người chơi (70%)', value = 'revive'},
					{label = 'Tính tiền',       value = 'billing'}
				}
			}, function(data, menu)
				if IsBusy then return end

				local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()

				if closestPlayer == -1 or closestDistance > 3.0 then
					ESX.ShowNotification(_U('no_players'))
				else

					if data.current.value == 'revive' then
						if disabled then
							ESX.ShowNotification('Lang băm không thể cứu người trong ~r~khu vực này~w~')
							return
						end
						IsBusy = true

						ESX.TriggerServerCallback('esx_langbam:getItemAmount', function(quantity)
							if quantity > 0 then
								local closestPlayerPed = GetPlayerPed(closestPlayer)

								if IsPedInAnyVehicle(PlayerPedId(), false) then
									ESX.ShowNotification('Không thể cứu khi đang trên xe')
								else
									if IsPedDeadOrDying(closestPlayerPed, 1) then
										-- local playerPed = PlayerPedId()

										-- ESX.ShowNotification(_U('revive_inprogress'))

										-- local lib, anim = 'mini@cpr@char_a@cpr_str', 'cpr_pumpchest'
										
										-- exports['progressBars']:startUI(13500, "Đang cấp cứu")

										-- for i=1, 15, 1 do
										-- 	Citizen.Wait(900)
									
										-- 	ESX.Streaming.RequestAnimDict(lib, function()
										-- 		TaskPlayAnim(PlayerPedId(), lib, anim, 8.0, -8.0, -1, 0, 0, false, false, false)
										-- 	end)
										-- end
										TriggerEvent("dpemotes:clearanim")
										TriggerEvent("mythic_progbar:client:progress", {
									        name = "doing_revive_lb",
									        duration = 13500,
									        label = "Đang cấp cứu",
									        useWhileDead = false,
									        canCancel = true,
									        controlDisables = {
									            disableMovement = true,
									            disableCarMovement = true,
									            disableMouse = false,
									            disableCombat = true,
									        },
									        animation = {
									            animDict = "mini@cpr@char_a@cpr_str",
									            anim = "cpr_pumpchest",
									        }
									    }, function(status)
									        if not status then
									            if randomrevive() then
	        									  	TriggerServerEvent('esx_langbam:removeItem', 'defibrillator')
	        										TriggerServerEvent('esx_langbam:relinhvive', GetPlayerServerId(closestPlayer))
	        										ESX.ShowNotification(_U('revive_complete', GetPlayerName(closestPlayer)))
	        									else
	        									  	ESX.ShowNotification(_U('revive_failed', GetPlayerName(closestPlayer)))
	        									  	TriggerServerEvent('esx_langbam:removeItem', 'defibrillator')
	        									end
									        end
									    end)

										-- if randomrevive() then
										--   	TriggerServerEvent('esx_langbam:removeItem', 'defibrillator')
										-- 	TriggerServerEvent('esx_langbam:langbam2077', GetPlayerServerId(closestPlayer))
										-- 	ESX.ShowNotification(_U('revive_complete', GetPlayerName(closestPlayer)))
										-- else
										--   	ESX.ShowNotification(_U('revive_failed', GetPlayerName(closestPlayer)))
										-- end
									else
										ESX.ShowNotification(_U('player_not_unconscious'))
									end
								end
							else
								ESX.ShowNotification(_U('not_enough_medikit'))
							end

							IsBusy = false

						end, 'defibrillator')

					elseif data.current.value == 'billing' then
					 --  	ESX.UI.Menu.Open(
						--     'dialog', GetCurrentResourceName(), 'billing',
						--     {
						--       title = _U('invoice_amount')
						--     },
						--     function(data, menu)
						--       local amount = tonumber(data.value)
						--       if amount == nil or amount < 0 then
						--         ESX.ShowNotification(_U('amount_invalid'))
						--       else
						        
						--         local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
						--         if closestPlayer == -1 or closestDistance > 3.0 then
						--           ESX.ShowNotification(_U('no_players_nearby'))
						-- 			  else
						-- 				menu.close()
						--           TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_langbam', 'Lang băm', amount)
						--         end
						--       end
						--     end,
						-- function(data, menu)
						--     menu.close()
					 --  	end)

					  	ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
					  		title = 'Thanh toán'
					  	}, function(data, menu)

					  		local amount = tonumber(data.value)
					  		if amount == nil then
					  			ESX.ShowNotification('So luong khong hop le')
					  		else
					  			menu.close()
					  			local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
					  			if closestPlayer == -1 or closestDistance > 3.0 then
					  				ESX.ShowNotification('Khong co ai gan ban ca')
					  			else
					  				TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), GetPlayerServerId(closestPlayer), 'Lang Băm', amount)
					  				ESX.ShowNotification('Da gui hoa don')
					  			end

					  		end

					  	end, function(data, menu)
					  		menu.close()
					  	end)
					end
				end
			end, function(data, menu)
				menu.close()
			end)
		end

	end, function(data, menu)
		menu.close()
	end)
end

-- Key Controls
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)

		if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'langbam' then
			if IsControlJustReleased(0, Keys['F6']) then
				OpenLangBamActionsMenu()
			end
		end
	end
end)

RegisterNetEvent('esx_langbam:putInVehicle')
AddEventHandler('esx_langbam:putInVehicle', function()
	local playerPed = PlayerPedId()
	local coords    = GetEntityCoords(playerPed)

	if IsAnyVehicleNearPoint(coords, 5.0) then
		local vehicle = GetClosestVehicle(coords, 5.0, 0, 71)

		if DoesEntityExist(vehicle) then
			local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle)

			for i=maxSeats - 1, 0, -1 do
				if IsVehicleSeatFree(vehicle, i) then
					freeSeat = i
					break
				end
			end

			if freeSeat then
				TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat)
			end
		end
	end
end)
local CurrentAction, CurrentActionMsg, CurrentActionData = nil, '', {}
local HasAlreadyEnteredMarker, LastHospital, LastPart, LastPartNum
local IsBusy = false
local spawnedVehicles, isInShopMenu = {}, false

Citizen.CreateThread(function()
	while IsBusy do
		Citizen.Wait(0)
		DisableControlAction(0, Keys['X'], true) -- Disable clearing animation
		DisableControlAction(0, Keys['~'], true) -- Disable wheel menu
	end
end)

]]

a="--// Decompiled Code. \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