Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| street [2026/07/07 13:04] – MapleTheFur | street [2026/11/20 05:33] (current) – [Sample Scripts] format sample script Bobble | ||
|---|---|---|---|
| Line 30: | Line 30: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| - | | '' | + | | '' |
| + | | '' | ||
| | '' | | '' | ||
| + | | '' | ||
| ==== Functions & Settings ==== | ==== Functions & Settings ==== | ||
| Line 64: | Line 66: | ||
| ==== Events ==== | ==== Events ==== | ||
| - | The street will send events when things happen, you can use the '' | + | The street will send events when things happen, you can use the '' |
| | **Event** | **Fires when** | **Callback receives** | | | **Event** | **Fires when** | **Callback receives** | | ||
| Line 87: | Line 89: | ||
| ==== Sample Scripts ==== | ==== Sample Scripts ==== | ||
| - | To do! | + | < |
| + | # Alert HELLO when a player is within the range of the door. | ||
| + | Street.on( " | ||
| + | if( Street.isPlayerNear( " | ||
| + | Street.sendEvent( " | ||
| + | } | ||
| + | }); | ||
| + | |||
| + | Street.on( " | ||
| + | if( name === " | ||
| + | alert(' | ||
| + | } | ||
| + | }); | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # A custom chat command that replies with the player' | ||
| + | document.addEventListener(" | ||
| + | Street.registerCommand(" | ||
| + | }); | ||
| + | function helloPlayer() { | ||
| + | const player = Street.me.streetName; | ||
| + | Street.say(`Hello ${player}!`); | ||
| + | } | ||
| + | </ | ||
