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
| Resource | Required | Notes |
|---|---|---|
| ox_lib | Yes | Latest release |
| oxmysql | Yes | 2.7 or newer |
| qbx_core / qb-core / es_extended | Yes | One of them |
| ox_target / qb-target | Optional | For 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.
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.
['example_item'] = {
label = 'Example Item',
weight = 100,
stack = false,
close = true,
},Start the resource
Add it to server.cfg after its dependencies.
ensure ox_lib
ensure oxmysql
ensure qbx_core
# HypeScripts
ensure example_scriptStart 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