Configuration
Every option in STG Ice Cream config/config.lua and config/functions.lua, from truck price and depot to flavors, prices, NPC customers, mods, stash and jingle.
All settings live in stg-icecream/config/config.lua, and the hooks for notifications, hunger, keys and fuel live in stg-icecream/config/functions.lua. Both files stay editable in the escrow version. Restart the resource after a change.
Language
Config.Language = 'en'Available: en, de, fr, es, pt, it, nl, pl, sv, no, fi, cs, ar, he, jp, zh. To change a text, edit the matching file in stg-icecream/locales/.
General
Config.Target = "auto"
Config.BrainFreeze = trueProp
Type
Truck ownership
Config.TruckPrice = 45000
Config.MaxOwned = 1
Config.MaxOwners = 2
Config.SellRefund = 50Prop
Type
Config.MaxOwners decides how exclusive the job feels. Keep it small to make the truck a rare sight, or set it to false for an open job anyone can buy into.
Window orders
Config.OrderTimeout = 600Seconds the owner has to serve a window order. Customers pay when they order, and the owner hands the treat over from the orders list. When the time runs out, the order is cancelled and the customer gets their money back. The owner can also cancel an order from the list.
Stock mode
Config.ItemStock = trueProp
Type
Switching from false to true moves any stock left on the truck into the owner's inventory the next time they open the depot menu.
NPC customers
Config.NpcCustomers = {
enabled = true,
startDelay = 5,
interval = { 25, 60 },
maxWaiting = 3,
patience = 120,
}While the owner stands behind the serving window and the truck has stock, NPC customers walk up and queue. Each one orders one or two of a random flavor that is in stock, at the owner's price. The owner serves them from the orders list and the money goes to the business balance. Leaving the window sends the queue away.
Prop
Type
Depot
The depot is where players buy, take out, restock and park their truck.
Config.Depot = {
blip = {
enabled = true,
sprite = 280,
color = 2,
scale = 0.8,
},
purchaseNpc = {
model = 'a_m_m_business_01',
coords = vec4(-1193.3252, -1505.5814, 4.3603, 306.9926),
},
spawn = {
vec4(-1195.1572, -1496.2030, 4.2716, 303.9391),
vec4(-1196.5087, -1493.2383, 4.2723, 303.8116),
vec4(-1198.5941, -1490.4137, 4.2715, 304.1167),
vec4(-1200.6649, -1487.2263, 4.2724, 303.8913),
},
park = vec4(-1191.6849, -1493.1750, 4.2812, 193.9754),
}Prop
Type
Soft serve machine
Config.SelfServe = {
capacity = 50,
basePrice = 8,
softServePrice = 40,
hunger = 12,
thirst = 15,
}Customers make their own cone at the machine in the back of the truck. They pay when they pull the lever, the money goes to the business balance, and they get it back if they leave the machine without taking the cone.
Prop
Type
Flavors
Config.Shop = {
maxPerBuy = 20,
items = {
{ name = 'stg_ice_cream_rocket', label = 'Rocket Pop', price = 12, sellPrice = 25, hunger = 5, thirst = 25, image = 'img/icecreams/rocket_pop.png' },
{ name = 'stg_ice_cream_taco', label = 'Cocoa Taco', price = 18, sellPrice = 35, hunger = 15, thirst = 10, image = 'img/icecreams/cocoa_taco.png' },
-- ...
},
}Prop
Type
Each entry in items is one packaged flavor:
Prop
Type
Each of the seven flavors has its own streamed model with bite stages. Change prices, labels and needs freely, but keep the item names: a new item name can be stocked and sold but cannot be eaten.
Price limits
Config.PriceLimits = {
flavors = { min = 1, max = 200 },
selfServe = { min = 1, max = 1000 },
}The range owners can set their prices in from the Prices tab. Prices outside it are pulled back to the nearest limit. NPC customers pay the owner's price too, so a high max also raises what NPC sales can earn.
Prop
Type
Mods
Config.Mods = {
livery = { default = 0, price = 2500 },
extra = { default = 2, price = 1000 },
}The Mods tab changes the truck's look. Every change is paid from the business balance.
Prop
Type
Stash
Config.Stash = {
slots = 30,
maxWeight = 100000
}Every truck has its own stash that only the owner can open, from behind the serving window. It works with ox_inventory and qb-inventory, detected automatically. To use another inventory, edit stg-icecream/server/editable/inventory.lua and stg-icecream/client/editable/inventory.lua.
Prop
Type
Jingle
Config.Jingle = {
volume = 0.5,
radius = 50.0,
maxVolume = 1.0,
minVolume = 0.1,
}Anyone in the truck can toggle the jingle with E. Every player in range hears it, louder the closer they are.
Prop
Type
Functions
stg-icecream/config/functions.lua connects the script to the rest of your server.
Config.Functions.Notify = function(type, message) ... end
Config.Functions.AddNeeds = function(hunger, thirst) ... end
Config.Functions.GiveKeys = function(plate, vehicle) ... end
Config.Functions.RemoveKeys = function(plate, vehicle) ... end
Config.Functions.SetFuel = function(vehicle, amount) ... end
Config.Functions.GetFuel = function(vehicle) ... end- Notify: shows the script's own ice cream toast. Replace the body to use your own notification system.
- AddNeeds: runs on every bite, so a half eaten treat gives half the value. Works out of the box with
esx_status, thehungerandthirststate bags used by QBOX, and the QBCore player metadata. - GiveKeys and RemoveKeys: give the owner keys when the truck comes out and take them back when it is parked. Supports
qbx_vehiclekeys,qb-vehiclekeys,qs-vehiclekeys,wasabi_carlock,t1ger_keys,mk_vehiclekeys,cd_garage,vehicles_keys,renzu_vehiclekeysandesx_vehiclelock. - SetFuel and GetFuel: save the fuel level when the truck is parked and restore it when it comes out. Supports
stg-vanaheimfuel,ox_fuel,LegacyFuel,cdn-fuel,ps-fuelandnd_fuel, and falls back to the game's own fuel level.
Still having trouble?
Open a ticket on our Discord. Our team answers around 15 hours a day.