Docs/Stores/Exports

Exports

Stores

Server

registerStore

Dynamically creates a store at runtime, syncing to all clients for use straight away, when the resource that creates it is stopped the store will be deleted and unregistered from all clients.

The storeData parameter is based upon the StoreProps.

Example

This will spawn a very basic shop with a store clerk at the coordinates listed.

{% code fullWidth="true" %}

lua
local storeData = {
    id = 'myNewTestStore', 
    type = 'buy', 
    name = 'My Test Store', 
    description = 'My Short Test Description', 
    icon        = 'fas fa-store', 
    modelType   = 'ped', 
    models      = {'mp_m_shopkeep_01'}, 
    locations   = {
        vector4(0,0,0,0),
    },
    paymentMethods = {'cash', 'bank'}, 
    stock = {
        {
          name = 'bread',  
          price = 100, 
        }
    },
}

exports.dirk_stores:registerStore(storeData)

{% endcode %}

Was this page helpful?
This page was last updated on 8 July 2025
DIRKSCRIPTS
All you need for your FiveM server.10% off your first order

Unsubscribe any time.

Copyright © 2026 DirkScripts. Not affiliated with or endorsed by Rockstar North or Take-Two Interactive.