Skip to content

Replace a part

How to replace a part ​

RLX is a base: nothing in it is mandatory except the core (rlx). Three ways to put your own work instead:

  1. A screen (character choice, interface, inventory window, HUD, death screen, appearance): remove the resource (rlx_identity, rlx_ui, rlx_inventory, rlx_hud, rlx_death, rlx_skin) and add yours, following its contract. Until yours is there, the core copes on its own.
  2. A gameplay resource (police, garage, shops, bank, fuel, voice…): remove it and add yours. They use only the public API, exactly like yours: read them as examples.
  3. A part of the core: turn its module off, then either let your resource do the job (death: listen to playerDeath, call RLX.Revive), or plug your logic into the framework with RLX.OverridePlayerMethod (inventory, bank) and hooks. The other resources keep calling xPlayer.addItem, RLX.OpenStash… and reach your code.

To change a behavior without replacing anything: hooks block or modify every important action, RLX.AddPlayerMethod adds your methods to every xPlayer, and events tell you everything that happens.