Example ScriptNew

Example Script: Installation

Get Example Script running on your server in a few minutes.

v1.0.0Escrow protectedQBox · QBCore · ESX

Before you start

Make sure OneSync is enabled and your server artifact is up to date.

Requirements

ResourceRequiredNotes
ox_libYesLatest release
oxmysqlYes2.7 or newer
qbx_core / qb-core / es_extendedYesOne of them
ox_target / qb-targetOptionalFor interactions

See Dependencies for download links and the start order.

Setup

Download the resource

Get the latest version from portal.cfx.re. See Download your purchase.

Import the SQL

Run install.sql on your database before the first start.

install.sql
CREATE TABLE IF NOT EXISTS `example_script` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `owner` VARCHAR(60) NOT NULL,
  `data` LONGTEXT DEFAULT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
);

Add the items

Add the item to your inventory.

ox_inventory/data/items.lua
['example_item'] = {
    label = 'Example Item',
    weight = 100,
    stack = false,
    close = true,
},

Start the resource

Add it to server.cfg after its dependencies.

server.cfg
ensure ox_lib
ensure oxmysql
ensure qbx_core

# HypeScripts
ensure example_script

Start order matters

If example_script starts before ox_lib, you will see No such export errors.

Verify

Restart your server and look for this line in the console:

[example_script] v1.0.0 started successfully

Next steps

On this page