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 browser) and the game projects it like a decal, lit like the world.
lua
local id = RLX.AddScreen({
page = "screens/tv.html", -- in your resource's webui folder (or url = "https://...")
position = { x = 441.0, y = -982.0, z = 31.5 },
direction = { x = 0, y = 1, z = 0 }, -- into the wall (straight down by default: the ground)
width = 3.2, height = 1.8, -- meters
resolution = { 1280, 720 }, fps = 30,
distance = 40, -- the page opens only within this distance
-- entity = netId: on a vehicle or an object (position and direction in its space)
})
RLX.EmitScreen(id, "wanted", { name = "John Doe", reward = 5000 }) -- to the page: lsmp.on("wanted", ...)
RLX.RemoveScreen(id)- Each player opens the page only near the screen, and closes it when they move away: a screen costs nothing far away. LS:MP allows 4 open 3D pages per resource on a player's machine.
- The last value sent for each event name is kept and given to a page opened later: a player who arrives sees the same thing as the others.
- Nothing to write on the client:
lib/rlx.luaopens and projects the page in your resource by itself (an LS:MP 3D page can only show its own resource's pages). - Example to copy:
rlx_basics(/screendemoputs a live screen on the wall you look at: game time, players online, announcements;server/screen.lua,web/screen.html).