Skip to content

Reference

States, zones, net events, instances, decals ​

Building blocks for any system: a phone, houses, races, heists, a job. All of them come with lib/rlx.lua; nothing to install.

  • States (shared values) — Small values every client sees (LS:MP meta), with change events.
  • Zones — Sphere, rotated box or polygon, with enter and exit. Checked by your resource itself: every 150 ms on the client, every 500 ms on the server for every player (or interval).
  • Net events, checked — RLX.RegisterNetEvent replaces lsmp.onClient when a client event can change something. It does the checks everyone forgets.
  • Instances — An instance is a private copy of the world (an apartment, a race, an interior), built on LS:MP dimensions. RLX hands out free ones so two resources never share one.
  • Decals — A decal is an image the game projects onto a wall, the ground, a vehicle or an object: a poster, a tag, a company logo on a car. It is lit like the world. LS:MP draws a decal on one client only;…
  • Clothes, synchronized scenes, view of a player (LS:MP) — Three things the LS:MP server does by itself, wrapped by RLX:
  • NPCs, held objects, effects and sounds
  • Routes of checkpoints — Deliveries, races, a driving school, a taxi fare. The server decides when a checkpoint is passed, from the player's real position: it follows the path between two checks, so a checkpoint crossed at…
  • Crafting — Recipes turn items (and money) into other items, at a bench, anywhere, or from your own script. The server checks and swaps everything at once: if the result does not fit in the inventory, nothing…
  • Asking a player — A card at the top of the screen, without stopping their game: they accept or refuse with two keys (actions requestAccept / requestDeny, Y / N by default, in the game's key settings; the number of…
  • Your own sounds and music — Like interact-sound or xsound: any sound file you put in rlx_ui/web/sounds/ (.ogg, .mp3, .wav), or an https:// URL (a radio stream, a song). Positional sounds follow their source and fade with the…
  • Dialogs with a character, camera paths
  • Zones watched by the server
  • Time played and AFK
  • Spectating
  • Screens in the world — A web page of your resource (HTML, a video, a live dashboard, a scoreboard...) shown on a wall, a sign, the ground or a vehicle, for every player, live: LS:MP renders the page into a texture (3D…
  • Scheduled tasks — At the server's real time, like a cron (server):
  • Ragdoll