scrollPraktische Skripts - Serverankündigung

Aim of the script

Let's make a script which will send customized broadcasts advertising. This will use the Broadcast and Wait methods to control the timing and content of advertisements.

Let's make a script called ad.txt and get to work!

# broadcast 1: thanking for playing on our server
# broadcast 2: "check out our github" or smth
# broadcast 3: "consider donating" ad for the moneys 🤑
# we also want to have a 2s gap between broadcasts for more ✨ finesse ✨

It's useful to write down what do we want to achieve with a given script.

Styling

First broadcast should look something like this:

Broadcast * 7s "Thank you for playing on Script Mania! Enjoy your stay!"

Which in turn looks something like this:

But we can do better! Using https://docs.unity3d.com/Packages/com.unity.textmeshpro@4.0/manual/RichTextSupportedTags.htmlarrow-up-right, we can use custom tags to spice up our broadcast like so:

Broadcast * 7s "<b><size=30><color=#cfc0fa>Thank you for playing on</color></size><br><size=50><color=#ffdc69>ScriptMania!</color></size><br><size=20>Enjoy your stay!</size></b>"

Composing the rest

For the sake of this tutorial, we will be using discord.gg/3j54zBnbbDarrow-up-right and ko-fi.com/elektrykandrzejarrow-up-right as placeholders. You should replace the contents of all broadcasts with what you want instead.

Using the same principles, we can add the 2nd:

And the 3rd broadcast:

Final result

circle-exclamation

Now you've created a complete advertising script!

Zuletzt aktualisiert