# MPP - Send Website To Nearby Chat Script V1.1.1 - Documentation

Sends a website link to the visitor who clicks the object, as a private line in their Nearby Chat, for example `Open My Pretty Pixels website: https://mpp-mainstore.com/`. Perfect for galleries, event booths and product showcases: your site, your store, your social page, one click away. An optional click sound plays at the object.

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

**New in V1.1:** the hover text is a setting; the link is checked once at start, with a warning in the script console when it is not usable (the object is then not clickable, and visitors never see an error); a silent one-second anti double-click per visitor; `Sound Volume` 0 is silent; the message and the sound are protected against a busy server. Settings labelled and grouped, and a `Debug Logging` switch. V1.1.1 only changes the version number. Your settings are kept when you update: see "Updating from V1.0".

---

## Quick Start

1. After purchase, the script is in your **Inventory** in Build mode. Add it to a sign, a business card, a logo.
2. In `Website/Website URL`, paste the full link (starting with `http://` or `https://`); in `Website/Website Name`, the name shown in the message.
3. Build and visit: hover the object ("Click then check Chat"), click it, the line appears in your Nearby Chat, in private.

That is all. The rest of this guide details every option.

---

## How It Works

- The hover text is `Activation/Hover Text` (default "Click then check Chat").
- A click plays `Sound/Click Sound` at the object (everyone nearby hears it), then whispers "Open <Website Name> website: <Website URL>" to the visitor who clicked. The link is clickable in the chat.
- A second click of the same visitor within one second is ignored, in silence: the link is already in their chat. Other visitors are never blocked.

In the Build panel the settings are grouped by category: `Activation/`, `Website/`, `Sound/` and `Debug/`.

---

## The Link

`Website/Website URL` must start with `http://` or `https://` (any letter case), continue after it, and contain no space. The link is checked once at start:

- valid: the object is clickable;
- empty or not valid: the object gets **no click interaction** (no hover text), and a warning in the script console tells you what to fix. Visitors never receive an error message.

`Website/Website Name` is the name in the message (default "My Pretty Pixels"; empty = "Website").

---

## Sound

`Sound/Click Sound`: an optional sound from your inventory, played at the object on each accepted click. `Sound/Sound Volume` goes from 0 to 200 percent (100 = the sound as recorded, 0 = no sound).

---

## Editor Properties Reference (6 total)

| Property | Type | Default | Description |
|---|---|---|---|
| Activation/Hover Text | string | "Click then check Chat" | Hover text; empty = the default text |
| Website/Website URL | string | "https://mpp-mainstore.com/" | Full link; empty or invalid = not clickable |
| Website/Website Name | string | "My Pretty Pixels" | Name in the message; empty = "Website" |
| Sound/Click Sound | SoundResource | (none) | Sound played at the object on click |
| Sound/Sound Volume | integer, 0-200 | 100 | Loudness in percent; 0 = no sound |
| Debug/Debug Logging | bool | Off | Writes the start settings, each accepted click, ignored double clicks and skipped messages to the script console |

---

## Version Notes

| Version | What changed |
|---|---|
| V1.0 | First release: link in the chat, website name, click sound, volume. Sold until V1.1.1 |
| V1.1.0 | Hover Text setting, link checked at start (invalid = no interaction, warning), silent anti double-click, Sound Volume 0 silent, guarded chat and sound, labels and groups, Debug Logging |
| **V1.1.1** (this version) | Version number only |

### Updating from V1.0

- **Your values carry over**: the 4 settings of V1.0 keep their internal names and their values. As with any update, take a screenshot of the Build panel first.
- **Labels**: `WebsiteUrl` becomes `Website/Website URL`, `WebsiteName` becomes `Website/Website Name`, `ClickSound` becomes `Sound/Click Sound`, `Volume` becomes `Sound/Sound Volume`. Same settings, same values.
- **Two new settings** at their defaults: `Activation/Hover Text` ("Click then check Chat", the fixed text of V1.0) and `Debug/Debug Logging` (Off).
- **What behaves differently**: an empty or invalid link gives no click at all (V1.0 answered "Invalid URL" to the visitor and played the sound); `HTTPS://` in capitals is accepted; a double click sends the line once; `Sound Volume` 0 is silent (V1.0 played at -48 dB).

---

## Recipes

**A - Business card.** Your site, `Hover Text` "Our website", a soft click sound.

**B - Social page.** The link of your page, `Website Name` "our Instagram": "Open our Instagram website: ...".

**C - Event booth.** One object per partner, each with its own link and name.

---

## Troubleshooting

| Symptom | Check |
|---|---|
| The object has no hover text | `Website URL` empty or invalid: a warning at start says why (it must start with http:// or https://, continue after it, contain no space) |
| I do not see the line | It is whispered to the visitor who clicked: look in your own Nearby Chat |
| Two clicks, one line | The one-second anti double-click: on purpose |
| No sound | A sound in `Click Sound`, `Sound Volume` above 0 |
| I want to post the link for everyone | Use an MPP - Action Button with a public chat text instead |
| I want to know what the script does | Turn `Debug/Debug Logging` On: the script console shows the start settings and each click |

---

## Limits

- The line is private to the visitor who clicked; there is no public mode.
- One link per object: for several links, use several objects.

---

## Related MPP Items

| Item | What it adds |
|---|---|
| **Open Creator Store Script** | Opens a creator's Sansar Store page on click. Store: https://www.sansar.com/store/listings/3d87d439-c908-4c2d-bd55-3d9969d2a524/open-creator-store-script |
| **Store Listing Opener Script** | Opens one Store listing on click or Action Button. Store: https://www.sansar.com/store/listings/8c7e1415-e339-4db5-98d1-6dfacee78d14/store-listing-opener-script |
| **Action Button Script** | Chat texts and script events from a button, private or public. Store: https://www.sansar.com/store/listings/3e1a3546-6c79-4527-bc1e-78d02648d19e/action-button-script |

---

*MPP - My Pretty Pixels. Send Website To Nearby Chat Script V1.1.1 (script `MPP - Send Website To Chat`). Store: https://www.sansar.com/store/listings/2b1465e7-ca59-4f7c-b01f-797ffb860ebe/send-website-to-nearby-chat-script*
