Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
street [2026/07/07 13:04] – MapleTheFurstreet [2026/11/20 05:33] (current) – [Sample Scripts] format sample script Bobble
Line 30: Line 30:
 | ''allowChat'' | Let members use the chat | ''true'' | | ''allowChat'' | Let members use the chat | ''true'' |
 | ''autoLoadOthers'' | Connect on load so the world shows before you enter the street | ''true'' | | ''autoLoadOthers'' | Connect on load so the world shows before you enter the street | ''true'' |
-| ''themeColour'' | UI accent colour (nametags, chat etc) | ''#2bbfff'' |+| ''themeColour'' | UI accent colour (nametags, backgound etc) | ''#2bbfff'' | 
 +| ''themeColourAlt'' | UI accent colour (nametags, text etc) | ''#4819ee'' |
 | ''disableStreet'' | Turn Main Street off for this page | ''false'' | | ''disableStreet'' | Turn Main Street off for this page | ''false'' |
 +| ''allowInFrame'' | Disable if the page is in an iFrame | ''false'' |
  
 ==== Functions & Settings ==== ==== Functions & Settings ====
Line 64: Line 66:
 ==== Events ==== ==== Events ====
  
-The street will send events when things happen, you can use the ''Street.on()'' function to subscribe to and event in your code and react to it in some way. For example, if a chat event has been recived you could script something to appear if it has the word "egg" in the message!+The street will send events when things happen, you can use the ''Street.on()'' function to subscribe to an event in your code and react to it in some way. For example, if a chat event has been recived you could script something to appear if it has the word "egg" in the message!
  
 | **Event** | **Fires when** | **Callback receives** | | **Event** | **Fires when** | **Callback receives** |
Line 87: Line 89:
 ==== Sample Scripts ==== ==== Sample Scripts ====
  
-To do!+<code> 
 +# Alert HELLO when a player is within the range of the door. 
 +Street.on( "tick", () => { 
 +    if( Street.isPlayerNear( "door", 50 ) ) { 
 +        Street.sendEvent( "open_door" ); 
 +    } 
 +}); 
 + 
 +Street.on( "event", (name, data, from) => { 
 +    if( name === "open_door" ) { 
 +        alert('HELLO');  
 +    } 
 +}); 
 +</code> 
 + 
 +<code> 
 +# A custom chat command that replies with the player's street name. 
 +document.addEventListener("DOMContentLoaded", function(event) { 
 +    Street.registerCommand("hello", helloPlayer, '/hello - welcomes the player'); 
 +});
  
 +function helloPlayer() {
 +    const player = Street.me.streetName;
 +    Street.say(`Hello ${player}!`);
 +}
 +</code>
  


@000 Melon
Land
Forum Art Hub Chat Webring Explore Random Recent Tenement Arcade Want to Login or Join ? Web Craft Guide Graphic Catalogue Wiki Help I'm Lost! Link Land Newsletters Image Stream Minecraft: Online Zap!
Passport Sites tamaNOTchi Asatte Add your site?
Aero Archive Onio Cafe 32 Bit Cafe Status Cafe