Exports
Client

Client Exports

preview

Request to show the preview modal for a lootbox, allowing players to view contents before opening.

exports.sleepless_lootbox:preview(caseName)

Parameters

ParameterTypeDescription
caseNamestringThe lootbox identifier to preview

Example

-- Show preview when player uses an item
RegisterNetEvent('myresource:previewCase', function(caseName)
    exports.sleepless_lootbox:preview(caseName)
end)

isRolling

Check if a lootbox roll animation is currently in progress.

local rolling = exports.sleepless_lootbox:isRolling()

Returns

TypeDescription
booleantrue if a roll is in progress, false otherwise

Example

if not exports.sleepless_lootbox:isRolling() then
    -- Safe to open another lootbox
    TriggerServerEvent('myresource:openCase', 'gun_case')
end

close

Close the lootbox UI.

exports.sleepless_lootbox:close()

Example

-- Force close the UI
exports.sleepless_lootbox:close()