GIG ScriptsGIG Scripts

Trap Phone

A burner phone for dealing with NPC customers, hiring dealers and buying stock.

Dependencies

  • OneSync
  • ox_lib
  • oxmysql
  • gig-trapPhone-assets (phone prop and sounds)
  • Qbox, QB-Core or ESX. Runs standalone too, with money and items disabled.
  • ox_target, qb-target or a text UI for talking to NPCs (cfg.interaction)
server.cfg
ensure gig-trapPhone-assets
ensure gig-trapPhone

Items

The phone sells whatever you list in cfg.drugs. Those items have to exist in your inventory already; the defaults are the usual weed_nugget, joint, coke_baggy, meth, lsd and oxy. Per drug you set a price range and the animation the customer plays when they use it.

Opening the phone can be tied to an item as well. Set cfg.item to the item name and make it usable; the icon is ui/item-icon.png. By default the phone opens with /burner, and cfg.keybind adds a key that players can rebind.

Item pictures inside the phone come from cfg.inventoryIconPath. The default points at ox_inventory's image folder; change the path if you use another inventory.

How it works

Customers text the player wanting to buy. The player negotiates a price, agrees a time window and a meeting spot, and hands over the product. Dealers are NPCs the player supplies with stock; they sell it over time and keep a cut. Deliveries are suppliers the player buys stock from through a shop scene. Everything is per character and saved.

There is a leaderboard with a reward for the top seller, reset on a schedule. Messages older than cfg.messageRetentionDays are cleaned up automatically.

Config

Settings are split across a few files:

FileContents
cfg.luaframework, phone behaviour, apps, nick generator, drugs, interaction, message retention, leaderboard
cfg_sv.luaDiscord webhooks for deals, shop purchases and dealer activity
data/customers.luathe customer NPCs, their dialogue and what they buy
data/dealers.luadealer NPCs, their cut, capacity and requirements
data/deliveries.luasuppliers and their stock
data/locations.luaspawn points for customers, dealers and deliveries

The data/ files are large because every NPC has its own lines. They are plain Lua tables, so you can add or remove NPCs freely. data/init.lua links locations to NPCs by id after everything has loaded; leave that file alone.

Commands and exports

CommandWhat it does
/burneropens the phone (cfg.command)
resetleaderboardserver console only, pays out and wipes the leaderboard now
exports['gig-trapPhone']:open()
exports['gig-trapPhone']:close()
exports['gig-trapPhone']:toggle()
exports['gig-trapPhone']:isOpen()

-- server
exports['gig-trapPhone']:addLeaderboardScore(src, points)

Webhooks

cfg_sv.lua has one URL per category. Leave a category empty to skip it; default catches everything that has no URL of its own.

On this page