Skip to content

Replace a part

Facade resources and their contracts ​

Each screen is a resource that announces itself to the core with RLX.RegisterProvider(kind) (on the client) and uses only the public API. To make yours: disable RLX's in resources.json, then follow the same contract.

KindResourceContractWithout it
charactersrlx_identityListen to rlx:characterSelection (session: chars, maxChars, canDelete, identity), call RLX.SelectCharacter(id), RLX.CreateCharacter({ firstname, lastname, dob, sex, height }), RLX.DeleteCharacter(id) (they return { ok, data, err }). rlx:characterSelected and rlx:playerLoaded say when to close.The first character is chosen; if there is none, a "New Citizen" is created.
uirlx_uiAnswer the local calls rlx:ui:menu, rlx:ui:input, rlx:ui:confirm, rlx:ui:progress, rlx:ui:cancelProgress, rlx:ui:settings (lsmp.onCall), listen to rlx:ui:textui (text or nil), rlx:ui:keyhints and rlx:ui:card (card: ID card, badge).Menus and inputs return nil (warning in the console); a progress bar waits for its duration and returns true.
notifyrlx_uiListen to rlx:notify (text, kind, ms).Game notifications (above the minimap).
skinrlx_skinListen to rlx:applySkin (appearance, sex) and dress the ped; answer rlx:skin:open (opts) with the saved appearance or nil; save with RLX.SaveSkin(appearance).The ped's default look.
inventoryrlx_inventoryListen to rlx:inventory:open / rlx:inventory:close, rlx:inventoryChanged; act with RLX.UseItem(slot), RLX.GiveItem(player, slot, n), RLX.GiveMoney(player, amount). Stashes: rlx:inventory:openStash and rlx:stashChanged (the stash), RLX.StashDeposit, RLX.StashTake, RLX.CloseStash() when closing.No window and no stashes (the player is told; everything else works).
hudrlx_hudrlx:setAccountMoney, rlx:setMeta, RLX.GetPlayerData().The game HUD.
deathrlx_deathListen to rlx:dead (delay in s; emitted again when the delay changes) and rlx:alive, call RLX.Respawn() when the player asks. Show the line other resources send with the local event rlx_death:hint (text, nil to clear).Automatic respawn at the hospital after the delay.

RLX.GetProviders() (client) tells who provides what.

Other replacements ​

You want…How
Your spawn point (apartment, selector)spawn hook.
Your inventory (logic)Config.Modules.inventory = false, then RLX.OverridePlayerMethod("addItem", ...) and the other inventory methods.
Your bankRLX.OverridePlayerMethod("addAccountMoney", ...) or the money hooks.
Your ambulanceConfig.Modules.death = false: listen to playerDeath, call RLX.Revive(source).
Your chatDisable rlx_chat, send the /… lines to the server: lsmp.emitServer("rlx:cmd", line).
Your admin commandsConfig.Modules.adminCommands = false, then RLX.RegisterCommand.
Your weaponsConfig.Modules.weapons = false: weapons are then plain items of your inventory, or your own system.
Your garages and persistenceConfig.Vehicles.persistent = false (vehicles go back to their garage), or Config.Modules.vehicles = false and your own table.
Your crafting, your ground items, your stashesConfig.Modules.crafting, drops, stashes = false, then your resource.
Your status system (hunger, thirst…)Config.Modules.status = false, then your resource.

Everything else is set in the shared/config.lua files of each resource; their texts are in their locales/ folder.