Configuration
Everything lives in config.lua, which stays editable in both the Open and Encrypted variant. There are no framework, inventory or notification options - those are handled by vns-core.
General
| Option | Default | What it does |
|---|---|---|
Config.Locale |
'en' |
Locale file to use from locales/. |
Config.DrawDistance |
10 |
Distance at which the shop marker is drawn. |
Hacking minigames
The hack is a chain: hack round 1 → hack round 2 → brute force. Failing any stage ends the hack.
Config.mHack = {
First = { Level = 5, Time = 25 }, -- mhacking level / timer (seconds)
Second = { Level = 4, Time = 20 },
}
Level and Time are passed to StartHackMinigame in client/client_open.lua - mhacking by default. If you plug in another minigame, use them however it expects.
Config.BruteForce = {
Lives = 5, -- do not put more than 5
Speed = { -- per-column speed, 8 columns, max 100
[1] = 65, [2] = 70, [3] = 75, [4] = 80,
[5] = 85, [6] = 90, [7] = 95, [8] = 100
},
Words = {
"NOMONEYS", -- MUST HAVE 8 LETTERS
"EZMONEYS",
"BITCOINS",
"HASHFIND",
}
}
One word is picked at random per attempt. Add as many as you like.
8 letters
Every word in Words must be exactly 8 letters - the brute-force screen has 8 columns.
Rewards
| Option | Default | What it does |
|---|---|---|
Config.Give.Min |
1 |
Minimum bitcoin items per successful hack. |
Config.Give.Max |
2 |
Maximum bitcoin items per successful hack. |
The reward is rolled on the server. It is only paid when the player used the laptop to start the hack, and the hack took between 15 seconds and 10 minutes.
Items
| Option | Default | What it does |
|---|---|---|
Config.DBItems.bitcoin |
'bitcoin' |
Item name of the bitcoin (reward and shop currency). |
Config.DBItems.device |
'druglaptop' |
Usable item that starts the hack. |
Breakable laptop
Config.BrokenLaptop = {
lose = false, -- break the laptop when the player fails the hack
prob = 3, -- % chance to break the laptop on SUCCESS (0 to disable)
name = 'brokenlaptop' -- item the laptop turns into
}
lose = true: failing any stage removes the laptop and gives abrokenlaptop.prob: after a successful payout, the laptop breaks with this % chance.- Both swap one device for one
nameitem, and the player gets themobile_brokenotification.
Shop position
Config.Zones = {
['Bitcoin'] = {
Pos = {x = -1052.04, y = -232.23, z = 43.02},
Size = {x = 1.5, y = 1.5, z = 1.5},
Color = {r = 246, g = 205, b = 61, a = 255},
Type = 1
},
}
Add more entries to place the shop at several positions - each opens the same shop with E within 1.2 m. Size and Color style the marker; setting Type = -1 hides that entry.
Shop stock
Config.Items = {
[1] = {name = 'tint_green', label = 'Tint Green', price = 3},
[3] = {name = 'grip', label = 'Grip', price = math.random(19,24)},
-- ...
}
| Field | What it does |
|---|---|
name |
Item name given on purchase. Names starting with weapon_ / WEAPON_ (e.g. WEAPON_PISTOL) are supported. |
label |
Menu entry title. |
price |
Number of bitcoin items removed on purchase. |
A math.random(min, max) price is rolled once on the server and shared with every player; it changes on server or resource restart. The menu shows the price with a ฿ sign. The server checks the price, the player's bitcoins and inventory space itself - if the item can't be given, the bitcoins are refunded.
Texts
Notification texts live in locales/en.lua:
| Key | Default |
|---|---|
bitcoin_added |
"You earned %s BitCoins." |
hack_failed |
"Hack failed" |
mobile_broke |
"Your mobile has broke." |
you_bought |
"You bought x1 %s" |
not_bicoins |
"You do not have enough BitCoins" |
not_space |
"You do not have enough space on your inventory." |
connect |
"Connecting" (progress bar) |
To add a language, copy the file (e.g. locales/de.lua with Locales['de'] = {...}) and set Config.Locale = 'de'. The "Press [E] to open the Shop" prompt and the "BitCoin Shop" menu title are fixed in the script.
Open files
| File | Functions |
|---|---|
client/client_open.lua |
ClientNotify, ShowConnectProgress, StartHackMinigame |
server/server_open.lua |
Usable item registration for the laptop, ServerNotify, GetPlayerItemCount, PlayerHasItem, PlayerCanCarryItem, GiveItemToPlayer, RemoveItemFromPlayer, GiveWeaponToPlayer, GetItemLabel |