Skip to content

CreateMapLight

Places a light on the level, for every player.

One of the game’s own lights at (x, y, z) - a lantern’s glow, a fire’s, a cold moonlit window. It is a map object like a placed mesh (moved, changed and deleted with SetMapObject / DeleteMapObject, on a layer, persist as theirs), never solid and nothing the server’s actors walk around. Its settings are its params ("r g b radius strength style"); the editor’s inspector changes them too.

CreateMapLight(x, y, z [, opts])
Parameter Type
x number metres
y number metres
z number metres; below 0 = on the ground
opts table any of r, g, b (the colour, 0 .. 1; a warm 1, 0.75, 0.5), radius (metres, 0.1 .. 50; 6), strength (0 .. 20; 1), style (the game’s light style - 0 steady, others flicker or pulse; 0), and CreateMapObject’s layer, group, persist, use (optional)

number - the light’s id; nil and the reason

-- a warm glow over the tavern's door, for this run of the mode
CreateMapLight(1291.5, 1102, 3.2, {radius = 8, strength = 2, persist = false})

CreateMapEffect · CreateMapSound · SetMapObject · the The server’s map group of the index