Exports and Integration

Events for use in other scripts

πŸ“¦ Open Store Menu Exposes two different ways to open a specific store menu, depending on whether you're calling it from the server or another client script. Useful when integrating with external scripts that need to trigger store access, such as missions, zones, or job-specific menus.

πŸ”Ή From the Server (Using a Trigger)

-- In a server-side script

local playerId = --[[ Get the player’s server ID ]]
local storeNumber = 1 -- The store number (1 for the first store, 2 for the second, etc.)

-- Trigger the event to open the store menu for that player
TriggerClientEvent('sleek-clothestore:openStoreMenu', playerId, storeNumber)

πŸ”Ή From Another Client Script (Using an Export)

local storeNumber = 1 -- The store number (1 for the first store, 2 for the second, etc.)

-- Call the exported function
exports['sleek-clothestore']:OpenStoreMenu(storeNumber)

πŸ”Ž The first store defined inside your Config.Stores = { ... } in shared/config.lua is considered store number 1, the second is number 2, and so on.

πŸ“ Note: You'll need to manually identify the correct store number based on its position in the Config.Stores list.


πŸ“¦ Open Wardrobe Export to open the wardrobe UI from another script, such as apartments or motel systems.

πŸ”Ή From Another Client Script (Using an Export)

exports['sleek-clothestore']:OpenWardrobe()

πŸ”Ž Opens the wardrobe directly for the current player. Make sure it's triggered under the right context (e.g. inside a property, near a closet, etc.).

Last updated