LaptopConfiguration

Configuration

Every setting in the Laptop's config.lua, and the open files for fitting it into your server.

On this page

The settings are in config.lua. The text players see is in locales/ (copy en.json to add a language); the language is set in tr_core's configuration.

These files aren't escrowed: config.lua, locales/*.json, install/, server/open.lua and client/open.lua.

Settings

SettingDefaultWhat it does
devModefalseAdmins install apps for free and at once. Keep it off on a live server
item'tr_laptop'The item's name
laptop.reach2.5Metres a player may move from the laptop before it closes
laptop.display'dui'Where the screen shows: 'dui' on the laptop itself, looked at close up, or 'nui' over the game
laptop.screen80How much of the player's screen it covers, in percent (50 to 100; up to 95 with 'dui')
laptop.blurtrueBlur the game behind the screen while it's open ('nui' only)
laptop.os'ifruitos'The system a new laptop comes with: 'ifruitos' (the Mac's look) or 'leafos' (Windows 11's)
store.account'bank'What apps are paid from when an app doesn't say: 'cash', 'bank' or 'dirty'
files.size32768Bytes one text file may hold (32 KB)
files.space262144Bytes all of a laptop's files may hold together, the Recycle Bin's too (256 KB)
files.count300Files and folders on one laptop
share.range10.0Metres two laptops may stand apart for nearby sharing
share.wait60Seconds the other player has to accept
sites{}Websites in the browser, without a resource of their own (1.2.0). See Adding websites

display, screen and blur are only where each player starts: they can change them for themselves in the laptop's Settings, and that's kept in their own game. os is only for new laptops; players switch in Settings.

Your server's rules

server/open.lua and client/open.lua are there for you to change, to fit the laptop into your server. A reason you return is a key under error in locales/en.json (like 'cant_now') or your own text.

FunctionChange it to
Open.canUse(src)serverStop some players opening a laptop from their inventory: a job, a zone. Return false and a reason
Open.canPlace(src, coords)serverStop a laptop being put down somewhere
Open.pay(src, account, amount, reason)serverTake the money for apps your own way. Return true once it's paid
Open.notify(src, text)serverShow what the laptop refused through your own notifications
Open.notify(text)clientThe same, on the client
Open.placed(src, serial, coords)serverLog or react when a laptop is put down
Open.pickedUp(src, serial)serverLog or react when a laptop is picked up
Open.installed(src, serial, app, price)serverLog or react when an app is bought (price 0 for free ones)
server/open.lua
function Open.canUse(src)
    if TR.player.hasJob(src, 'police') then
        return false, 'cant_now'
    end
    return true
end
Was this page helpful?

Still stuck? Open a ticket on Discord.Privacy