Skip to main content
HomeAll
Store›MorganeParis›Light Switch Script
Light Switch Script

Light Switch Script

95
Log in to like
Item name
Light Switch Script
Category
Scripts
Min. resale price
100
Listed
2/7/2026

Description

Version 1.5.3 Smart and synchronized control for lights and materials. MPP – LightSwitch is an advanced lighting control system for Sansar that allows creators to manage lights and emissive materials with precision, synchronization, and smooth transitions. More than a simple on/off switch, this script can coordinate entire lighting systems across multiple objects using ScriptEvents, chat commands, and interactive clicks. Perfect for immersive environments such as interactive buildings, stage lighting, sci-fi environments, or synchronized ambient scenes. Since 1.5: one anti-spam protection for every way of switching a lamp (the last command is never lost), a private "please wait" message when a switch is clicked too soon, access by avatar handle or UUID, a private message for denied visitors, smoother long fades, and a Build panel organized by category. New in 1.5.3: the transition mode is chosen by a number (1 to 5, no name to type), and the access control uses the same Permission Mode + Whitelist + Blacklist scheme as every MPP script. See "Updating from 1.5.1" below before you update lamps already placed in a scene. ________________________________________ Key Features Light control • Toggle one or multiple LightComponents • Control relative intensity and color • Smooth interpolated transitions, even over several seconds Material control • Adjust Emissive Intensity (shader dependent) • Modify Tint on compatible materials • Fully synchronized with lights Group synchronization • Synchronize multiple lamps or objects using ScriptEvents • Perfect for large lighting systems • Ideal for stage lighting or multi-room environments Chat commands • Control lights using Nearby chat • Examples: /lamp on, /lamp off, /lamp toggle, /lamp street on, /lamp * toggle • Optional group targeting External script control • Supports ScriptEvents from other scripts • Compatible with MPP – Action Button, MPP – Day and Night Sky Cycle (lamps on at sunset, off at sunrise) and the arrival events of MPP – Commands Help On Chat • Allows full integration into interactive gameplay systems Access control — Permission Mode • Mode 1: owner only · Mode 2: owner + the avatars of the Whitelist · Mode 3 (default): everyone except the avatars of the Blacklist • Avatar handles or UUIDs (unique), no more display names • The scene owner can never be locked out • Private message for denied visitors (customizable, or silent) • Optional: hide the switch from denied visitors • Applies to both click and chat actions; script events are never restricted Anti-spam • One cooldown for clicks, chat, groups and script events • A command received during the cooldown is applied at its end: the lamp always ends in the last requested state • Commands sent together count as one: no blink when Day Night brings the lamps up to the time of day • A click during the cooldown gets a private "please wait" message with the remaining time (customizable, or silent) • Protects your scene from spam and from runaway scripts ________________________________________ Technical Details • Supports multiple LightComponents per object • Shared transition system for lights and materials • Transition Mode by number: 1 Linear, 2 Smoothstep, 3 EaseIn, 4 EaseOut, 5 Step • External ScriptEvent system for advanced automation • Settings grouped by category in the Build panel (Activation, Light, Material, Transition, Access, Chat, Events, Debug) • Robust under load: one failing light or material never stops the others • Optimized and clean script architecture ________________________________________ Example Use Cases • Interactive lamps • Street lamps switched automatically at sunset • Building lighting systems • Stage and concert lighting • Sci-fi control panels • Fully synchronized ambient lighting • Lamps that light up when a visitor arrives (with Commands Help On Chat 1.5) ________________________________________ MPP – LightSwitch is designed for creators who want professional, immersive, and scalable lighting control in their Sansar experiences. Full documentation online: https://mpp-mainstore.com/sansar/LightSwitch/ ________________________________________ Updating from 1.5.1 — please read • Take a screenshot of the Build panel of one lamp of each kind BEFORE updating the script. • All your settings are kept, except two: the Transition Mode (now a number, back to 2 = Smoothstep: enter 1 Linear, 3 EaseIn, 4 EaseOut or 5 Step if your lamps used another mode) and the access (Owner Only and Access List are replaced by Permission Mode, Whitelist and Blacklist, which start at "everyone can click"). • After the update, set the access again on the lamps that had one: Owner Only On → Permission Mode 1 (or 2 with your list in the Whitelist); Owner Only Off with a list → Permission Mode 3 with your list in the Blacklist. • Event names, chat commands and group sync are unchanged: Day Night, Action Button and your own scripts keep working as they are. Changelog — Version 1.5.3 • Transition Mode chosen by a number (1 Linear, 2 Smoothstep, 3 EaseIn, 4 EaseOut, 5 Step) instead of a name to type. • Access control by Permission Mode (1 owner only, 2 owner + whitelist, 3 everyone except blacklist), with separate Whitelist and Blacklist, the same scheme as every MPP script. • Labels aligned with the other MPP scripts: Hover Text When ON / OFF, Enable Chat Commands, Enable Script Events, Script Event Prefix; groups in the order Activation, Light, Material, Transition, Access, Chat, Events, Debug. • Module listed as "MPP - Light Switch". • Two settings to enter again after the update (see "Updating from 1.5.1" above); everything else is kept. Changelog — Version 1.5.1 • One anti-spam cooldown for click, chat, group sync and script events; the last command is never lost. • Access control by avatar handle or UUID; the owner is never blocked. • Private message for denied visitors, and option to hide the switch from them. • Private "please wait" message for a click during the cooldown, with the remaining time. • Smoother light fades, adapted to the transition duration. • Settings grouped by category in the Build panel. • More robust updates of lights and materials in busy scenes. • Event names, chat commands and group sync unchanged. Changelog — Version 1.4.2 • Added external ScriptEvent support allowing other scripts to control lights. • Added compatibility with MPP – ActionButton and other event-based systems. • Improved group synchronization system for multi-lamp setups. • Added additional external event patterns for group and global control. • Improved transition handling and interpolation stability. • Internal code optimization and cleanup. ________________________________________ Enjoy and Keep Good Vibes. Hugs from Morgane. ________________________________________