[FREE] [ESX + QBCORE] Scratch Tickets 🎫

I updated the releases. If I forget it in the future, you can always just get it directly from the main branch.

Is there anyway to have different rarity tickets with different prizes for each? Like having a tier 1 ticket with money only as prizes, a tier 2 that has money and items, ectr

Not preconfigured, no. Could be made by someone. I currently don’t do a lot of fivem development anymore

when I try to give myself the item in qbcore it says SYSTEM: Cant give the item
I added it to items.lua

local cooldown = 0

local animDict = “[email protected][email protected]@base”

local animName = “base_female”

RegisterNetEvent(“dr-scratching:startScratchingEmote”, function()

local ped = GetPlayerPed(-1)

local pedPos = GetEntityCoords(ped, false)


while not HasAnimDictLoaded(animDict) do



-- TaskStartScenarioInPlace(GetPlayerPed(-1), "PROP_HUMAN_PARKING_METER", 0, true)

TaskPlayAnim(ped, animDict, animName, 8.0, -8.0, -1, (2 + 16 + 32), 0.0, 0, 0, 0)


RegisterNetEvent(“dr-scratching:stopScratchingEmote”, function()

-- ClearPedTasksImmediately(GetPlayerPed(-1))

local ped = GetPlayerPed(-1)



^ This will close ESX inventory and will not kick you out of car if you use the scratch off in a car

Hello, I have a Problem with this Script

Anyone can Help me pls.

This is in the Data.

local count = xPlayer.getInventoryItem(‘scratch_ticket’).count
if count >= 1 then
– removing ticket
xPlayer.removeInventoryItem(‘scratch_ticket’, 1)
if Config.ShowUsedTicketNotification then
print((’%s (%s) somehow used a scratching ticket without having one. Cancelled’):format(GetPlayerName(_source), GetPlayerIdentifier(_source, 0)))

I’ll ask you the hardest question so far for QBcore owners: where are we supposed to get a scratch from in the first place? not a damn icon on the map or wiki explaining me that.

you implement it into one of your shops, 24/7 etc i have mine on the casino lucky wheel as a prize, just add it in like any other item.

Hi, yeah sorry for the inconvenience. The installation guide covers it though.

So you can now basically do whatever you want with it, add it in a shop, make it a price when winning in some other gamemode, make admins only give the item through a command, make players spawn with it, find it in trash cans, … The possibilities are endless and that’s outside the scope of the resource. The resource is just the functionality of the scratch ticket. Goodluck :smile:

Hello, the logs don’t work for me. Any tip or someone could help me ?

Hi, if you’re talking about the webhook (recommended) - make sure the /config.lua: Config.Webhooks are configured properly, and your webhook URL is correctly set at server/s_webhooks.lua.

Otherwise, you will only get non-important logs if you enable debugMode, see Debugmode · xDreamLand/dr-scratching Wiki · GitHub. Please avoid using it in production as logs have an impact on the performance. Important logs e.g. possible cheating attempts will be logged in server console and by webhook (if configured).


V3.2.0 Resolve thrown out of vehicle on ticket usage

  • New update resolves being thrown out of a vehicle on ticket usage.

If you find any further issues please let me know!

xDreamLand aka Ruwbix :mascot:

[script:dr-scratching] Error loading script server/s_main.lua in resource dr-scratching: @dr-scratching/server/s_main.lua:12: attempt to index a nil value (global ‘ESX’)
[script:dr-scratching] stack traceback:
[script:dr-scratching] @dr-scratching/server/s_main.lua:12: in main chunk
[ c-scripting-core] Failed to load script server/s_main.lua.
[ citizen-server-impl] Started resource dr-scratching

i have this error can you help ?

I shot you a DM on Discord

V3.3.0 Resolved SharedObject import for the latest ESX versions, independent version URLS

  • Resolve attempt to index a nil value (global ‘ESX’) for latest ESX versions. Resource should also improve performance wise on the ESX framework (less iterations).
  • Changed the URL for the QBCore version messages to an independent URL so QBCore won’t be receiving messages in console when only ESX needs an update (like now), and vice versa.

If you find any further issues or have a suggestion please let me know!

xDreamLand aka Ruwbix :mascot: