← MPP-Mainstore › Scripts MPP - Random Object Spawner Download the documentation (.md)

Version 1.5.2 · updated September 24, 2026

MPP - Random Object Spawner Script V1.5.2 - Documentation

Makes objects appear in your scene: one random item from your list, at a fixed spot or anywhere inside a radius, when a visitor clicks the spawner, every few minutes on its own, or when another script asks for it (an MPP - Action Button, a scheduler). Keeps the scene clean with a maximum of active objects, a cleanup chat command and a cleanup event. Access by permission mode, per-visitor "not allowed" message, optional sounds.

This script is standalone - it does not require any other MPP script to function.

New in V1.5: settings grouped by category, the access scheme shared by every MPP script (Access/Permission Mode (1-3) with a Whitelist and a Blacklist, avatar handles accepted), an Enable Click switch, a private Denied Text for refused clicks, the option to hide the spawner from denied visitors, a cleanup command that follows the permissions and must be typed exactly, a maximum of active objects that holds even under fast clicks, empty list slots skipped instead of destroying an object for nothing, Volume 0 = silent, and warnings in the script console for risky settings. Two settings of V1.4.7 are not carried over: read "Updating from V1.4.7" before you update spawners already placed in a scene.


Quick Start

  1. After purchase, the script is in your Inventory in Build mode. Add it to the object that will be the spawner: a pedestal, a chest, a machine.
  2. Fill Spawn/Spawnable Clusters with one or more cluster resources from your inventory (the objects to make appear).
  3. Set Spawn/Position Offset: where the objects appear, in meters from the spawner (for example <0,0,1> = one meter above it). Leave Spawn/Spawn Radius at 5 for a random spot around that point, or set it to 0 for the exact spot.
  4. Choose who may click: Access/Permission Mode (1-3) is 1 by default (you only). Set it to 3 for a spawner open to everyone.
  5. Set Spawn/Max Active Items (for example 10) so the scene never fills up: the oldest object is removed before a new one appears.
  6. Build and visit: hover the spawner, read "Spawn Object", click.

The rest of this guide details every option.


How It Works

SourceSettingCooldownAccess check
ClickActivation/Enable ClickYes, for everyoneAccess/Permission Mode (owner always allowed)
Auto spawnActivation/Auto Spawn MinutesNoNone
Script Event (button, scheduler, your script)Events/Spawn Event NameYes, the sameEvents/Use Click Permission (see "Script Events")
Cleanup (chat command or event)Activation/Clean Command, Events/Clean Event NameNoOwner always; others per Permission Mode

Each spawn picks one filled entry at random in Spawnable Clusters, computes the spawn point (spawner position + Position Offset, then a random point inside Spawn Radius, never below Min Spawn Height), removes the oldest object if Max Active Items is reached, creates the object with Rotation, and plays Spawn Sound at the new object.

In the Build panel the settings are grouped by category: Activation/, Spawn/, Access/, Events/, Sound/ and Debug/.


Activation


Spawn

SettingDefaultWhat it does
Spawn/Spawnable Clusters(empty)Up to 20 cluster resources. Each spawn picks one filled entry at random. Empty slots are skipped and reported in the script console at start
Spawn/Position Offset(none)Offset in meters (X, Y, Z) from the spawner to the spawn point, in the scene axes (it does not turn with the spawner)
Spawn/Rotation(none)Rotation of each spawned object in degrees (X, Y, Z), absolute in the scene axes
Spawn/Spawn Radius5Radius in meters of the sphere around the spawn point where objects appear at random. 0 = always exactly at the spawn point
Spawn/Min Spawn Height1Absolute scene height (Z) in meters: a spawn point below it is raised to it, also with a radius of 0
Spawn/Max Active Items0Most objects kept at once (1 to 100). At the limit the oldest one is destroyed before a new one appears. 0 = unlimited: set a limit on any spawner open to visitors

Tip for a single-item rezzer: one entry in the list, Spawn Radius 0, Max Active Items 1. Each click replaces the object.


Access Control

Who can click, use the Clean Command and, with Use Click Permission On, send events, is set by one number and two lists, in the Access/ group. This is the scheme shared by every MPP script:

Access/Permission ModeWho is allowed
1 - Owner only (default)The scene owner only
2 - Owner + WhitelistThe scene owner and the avatars of Access/Whitelist (empty list = owner only)
3 - Everyone except BlacklistEveryone, minus the avatars of Access/Blacklist (empty list = everyone)

Script Events (buttons, schedulers, your own scripts)

With Events/Enable Script Events On (default), the spawner listens to two Script Events:

Event (default name)Effect
mpp_randomspawn_spawn (Events/Spawn Event Name)Spawns one object, like a click, with the same cooldown
mpp_randomspawn_clean (Events/Clean Event Name)Removes every object this spawner created

Several spawners with the same names all react to one event; give each spawner its own names to target them.

Who may send them: Events/Use Click Permission (default On):

A refused event is silent for the visitor (Debug Logging writes it in the console). Empty event names are not listened to; the two names must differ.

From an MPP - Action Button: Send as Command On and Command 1 = mpp_randomspawn_spawn (or the clean name). From your own script: post the event name, and send the same data as Action Button when you want the access check to know the avatar (an object with a text property ActivatorAvatarUuid holding the avatar's UUID).


Sound

SettingDefaultWhat it does
Sound/Spawn Sound(none)Played at the new object when it appears
Sound/Spawn Volume1000 to 200 percent (100 = as recorded, 0 = no sound)
Sound/Clean Sound(none)Played at the spawner when the objects are removed
Sound/Clean Volume1000 to 200 percent (0 = no sound)

Editor Properties Reference (26 total)

Activation

PropertyTypeDefaultDescription
Activation/Enable ClickboolOnClick on the spawner; Off = no click and no hover text
Activation/Hover Textstring"Spawn Object"Hover text (128 characters, 4 lines at most); empty = Spawn Object
Activation/Cooldown Secondsnumber, 0-6005Wait after a spawn by click or event, for everyone; hover text hidden meanwhile
Activation/Auto Spawn Minutesinteger, 0-600One spawn every N minutes on its own; 0 = Off
Activation/Clean Commandstring"/CleanSpawned"Exact Nearby Chat command that removes the spawned objects; empty = Off

Spawn

PropertyTypeDefaultDescription
Spawn/Spawnable Clusterslist of clusters(empty)The objects to spawn, one picked at random
Spawn/Position OffsetVector(none)Spawn point, in meters from the spawner
Spawn/RotationVector(none)Rotation of the spawned objects, in degrees
Spawn/Spawn Radiusnumber, 0-10005Random distance around the spawn point; 0 = exact spot
Spawn/Min Spawn Heightnumber, -2000-20001Lowest scene height of a spawn point
Spawn/Max Active Itemsinteger, 0-1000Objects kept at once, oldest removed first; 0 = unlimited

Access

PropertyTypeDefaultDescription
Access/Permission Mode (1-3)int (1-3)11 = Owner only, 2 = Owner + Whitelist, 3 = Everyone except Blacklist. The owner is always allowed
Access/Whiteliststring""Handles or UUIDs allowed in mode 2
Access/Blackliststring""Handles or UUIDs blocked in mode 3
Access/Denied Textstring"You are not allowed to use this spawner."Private message for a refused click (empty = silent)
Access/Hide From DeniedboolOffDenied avatars do not see the spawner as clickable

Events

PropertyTypeDefaultDescription
Events/Enable Script EventsboolOnListens to the two events below
Events/Spawn Event Namestring"mpp_randomspawn_spawn"Spawns one object (same cooldown as a click); empty = off
Events/Clean Event Namestring"mpp_randomspawn_clean"Removes the spawned objects; empty = off
Events/Use Click PermissionboolOnOn = the event's avatar must pass Permission Mode (no avatar: mode 3 only). Off = every event accepted

Sound

PropertyTypeDefaultDescription
Sound/Spawn SoundSoundResource(none)Sound at the new object
Sound/Spawn Volumeinteger, 0-200100Loudness in percent (0 = no sound)
Sound/Clean SoundSoundResource(none)Sound at the spawner on cleanup
Sound/Clean Volumeinteger, 0-200100Loudness in percent (0 = no sound)

Debug

PropertyTypeDefaultDescription
Debug/Debug LoggingboolOffWrites spawns, cleanups, access decisions (with the avatar handle and UUID) and the start state to the script console

Version Notes

VersionWhat changed
V1.4.6Max Active Items: a limit of active objects, the oldest replaced first (1 = single-item rezzer)
V1.4.7Sold until V1.5.2
V1.5.0Settings grouped by category; Clean Command exact, following the permissions (the owner always); Denied Text for refused clicks; Max Active Items held under fast clicks; empty list slots skipped; 0.1 s safety between spawns; Volume 0 = silent; handles accepted in the lists; auto spawn keeps going after an error; warnings at start
V1.5.1Permission Mode as a number (never sold)
V1.5.2 (this version)Access/Permission Mode (1-3), the scheme shared by every MPP script, with Whitelist and Blacklist; Activation/Enable Click; Access/Hide From Denied; Use Click Permission decides alone what happens to events without an avatar (Allow Without Avatar removed)

Updating from V1.4.7

Before you update, take a screenshot of the Build panel of one spawner of each kind. Two settings are replaced by new ones and their values are not carried over.

V1.4.7 Permission ModeV1.5.2
NobodyActivation/Enable Click Off (auto spawn and events keep working; set Permission Mode for the events)
EveryonePermission Mode 3, Blacklist empty
OwnerOnlyPermission Mode 1 (nothing to do)
WhitelistOnly, OwnerAndWhitelistPermission Mode 2 (the owner is now always allowed)
BlacklistOnlyPermission Mode 3 with your list in Blacklist

Recipes

A - A pedestal that shows one item. One entry, Spawn Radius 0, Max Active Items 1, Permission Mode 3: each click replaces the item on the display spot.

B - Random props over time. Several entries, Auto Spawn Minutes 5, Max Active Items 10, Enable Click Off: props appear on their own, never more than ten.

C - A loot button. An MPP - Action Button with Send as Command On and Command 1 = mpp_randomspawn_spawn; on the spawner, Use Click Permission On and Permission Mode 3 so everyone can press it, Max Active Items set.

D - A reward for your staff. Permission Mode 2 with their handles in Whitelist, Hide From Denied On: visitors do not even see the spawner as clickable.

E - A cleanup button for you. An MPP - Action Button with Command 1 = mpp_randomspawn_clean and Access/Permission Mode 1 on the button; or simply type /CleanSpawned in the chat.


Troubleshooting

SymptomCheck
Visitors cannot click after the updateAccess/Permission Mode starts at 1 (owner only): set 3, or 2 with a Whitelist (see "Updating from V1.4.7")
Nothing appears on clickSpawnable Clusters filled? A warning at start names an empty list. The hover text hidden = cooldown running
No hover text at allActivation/Enable Click Off, or you are a denied visitor with Hide From Denied On, or the cooldown is running
The object appears under the floor or too farCheck Position Offset (scene axes, not the spawner's), Spawn Radius, Min Spawn Height
/CleanSpawned does nothingTyped exactly, alone in Nearby Chat? As a visitor, you must be allowed by Permission Mode. The owner can always clean
My button does nothingEvents/Enable Script Events On, same event name on both sides? With Use Click Permission On, the visitor must be allowed; an event without avatar passes in mode 3 only
The scene fills upSet Spawn/Max Active Items
A visitor in my list is still refusedHandles or UUIDs, not display names; Permission Mode must use that list (2 for the Whitelist, 3 for the Blacklist). Turn Debug/Debug Logging On to read the handle
Warnings at startThey name the setting to fix: empty list, same name for both events, a list not used by the mode, no way to spawn (click Off, auto spawn 0, no event), unlimited items on a spawner open to visitors

Limits


ItemWhat it adds
Action Button Script (V1.7.1)Spawn and cleanup buttons with mpp_randomspawn_spawn and mpp_randomspawn_clean, with their own access control. Store: https://www.sansar.com/store/listings/3e1a3546-6c79-4527-bc1e-78d02648d19e/action-button-script
MPP - Day and Night Sky CycleIts scheduler can post the spawn event at a given hour (an event without avatar: Use Click Permission Off or Permission Mode 3)

MPP - My Pretty Pixels. Random Object Spawner Script V1.5.2 (script MPP - Random Object Spawner). Store: https://www.sansar.com/store/listings/1de81a6d-1e59-4b68-9423-c11b4deaa61d/random-object-spawner-script

↑