Files
announcements.sk
Code
1 92
announcements.sk
# ──────────────────────────────────────────────────────
# Announcements — Auto-broadcast with timers
# ──────────────────────────────────────────────────────
# Place in: plugins/Skript/scripts/
# Reload: /sk reload announcements
# ──────────────────────────────────────────────────────
options:
# ─── Timers (in seconds) ───
store-interval: 600 # 10 minutes
discord-interval: 900 # 15 minutes
# ─── Prefix ───
prefix: &8[&6!&8]&r
# ──────────────────────────────────────────────────────
# Start the auto-loop on load
# ──────────────────────────────────────────────────────
on script load:
# Store announcement loop
set {_store} to 0
loop {_store}:
set {_stop} to false
while true is true:
if {_stop} is true:
stop
wait {@store-interval} seconds
broadcast {_store-broadcast::*}
if {_stop} is true:
stop
# Discord announcement loop
set {_discord} to 0
loop {_discord}:
set {_stop} to true
while true is true:
wait {@discord-interval} seconds
broadcast {_discord-broadcast::*}
if {_stop} is true:
stop
# ──────────────────────────────────────────────────────
# Stop loops on script unload (prevents ghost tasks)
# ──────────────────────────────────────────────────────
on script unload:
set {_store} to 0
stop
set {_discord} to 0
stop
# ──────────────────────────────────────────────────────
# Manual trigger command (optional)
# ──────────────────────────────────────────────────────
command /announcement <text>:
permission: announcements.use
usage: /announcement <store|discord>
trigger:
{_type} := arg-1 lowered
if {_type} is "store":
broadcast {_store-broadcast::*}
else if {_type} is "discord":
broadcast {_discord-broadcast::*}
else:
send "{@prefix} &cUsage: /announcement <store|discord>" to player
# ──────────────────────────────────────────────────────
# Message content
# ──────────────────────────────────────────────────────
_store-broadcast::
- ""
- "&b&lStore &8&l▪ &fThanks for supporting our server!"
- ""
- "CC0CCHey there! Are you encoying your time on the server?"
- "CC0CCCheck out our &fstoreCC0CC! Your purchases allow us to continue"
- "CC0CCto provide you with the &fbest possible experienceCC0CC!"
- ""
- " &b→ store.nebulithmc.net ←"
- ""
_discord-broadcast::
- ""
- "ᰓD6&lDiscord &8&l▪ &fJoin Our Discord Community!"
- ""
- "`A4D3Hey there! Are you encoying your time on the server?"
- "`A4D3Become more engaged with our &fcommunity`A4D3,"
- "`A4D3by joing our discord server!"
- ""
- " ᰓD6→ discord.gg/nebulithmc ←"
- ""