Skip to main content

Exports and Events

Client Exports

GetStoreEntity

Get a store entity from a specific store id

Arguments:

  • storeId: number - The store id
  • entityType: "clerk" | "till" | "safe" - The entity type
local entity = exports.loaf_storerobbery:GetStoreEntity(storeId, entityType)

GetConfig

local config = exports.loaf_storerobbery:GetConfig()

GetClosestStoreFromCoords

Arguments:

  • coords: vector3 - The coords to check from
  • maxDistance?: number - The max distance to check from, optional
local storeId, distance, store = exports.loaf_storerobbery:GetClosestStoreFromCoords(coords, maxDistance)

Client Events

loaf_storerobbery:entityCreated

Triggered when a store entity is created. Useful to update the entity in your shop script.

Data:

  • netId: number - The entity net id
  • entityType: "clerk" | "till" | "safe" - The entity type
  • storeId: number - The store id
RegisterNetEvent("loaf_storerobbery:entityCreated", function(netId, entityType, storeId)
-- Update the entity in your shop script
end)

Server Exports

GetStoreEntity

Get a store entity from a specific store id

Arguments:

  • storeId: number - The store id
  • entityType: "clerk" | "till" | "safe" - The entity type
local entity = exports.loaf_storerobbery:GetStoreEntity(storeId, entityType)

GetGlobalCooldown

Get the global cooldown in seconds

local cooldown = exports.loaf_storerobbery:GetGlobalCooldown()

GetCooldown

Get the cooldown for a specific store in seconds

Arguments:

  • storeId: number - The store id
local cooldown = exports.loaf_storerobbery:GetCooldown(storeId)

SetStoreClerkEntity

Set the clerk entity for a specific store

Arguments:

  • storeId: number - The store id
  • clerkEntity: number - The entity handle
local success = exports.loaf_storerobbery:SetStoreClerkEntity(storeId, clerkEntity)

GetConfig

local config = exports.loaf_storerobbery:GetConfig()

GetClosestStoreFromCoords

Arguments:

  • coords: vector3 - The coords to check from
  • maxDistance?: number - The max distance to check from, optional
local storeId, distance, store = exports.loaf_storerobbery:GetClosestStoreFromCoords(coords, maxDistance)