Jump to content

Advertisement Announcement Skript


awel

Recommended Posts

Got bored and made a skript that a lot of people in the minehut community who want to grow their server may want to use!
Took me like 10 - 20 minutes (mostly worth of debuging a stupid issue) To make so if you find a issue please respond so I can quickly fix it ;D

The Skript:

(Forogt the requrements but, I think its TuSKe or something)

 

#Enjoy ;D

options:
    permission: permission.everyone

command /adalerts:
    permission: {@permission}
    permission message: &cNo permission to do that!
    trigger:
        open virtual chest inventory with size 1 named "&a&lAd-Alerts" to player
        wait 1 tick
        format gui slot 0 of player with emerald block named "&A[VIP]" with lore "&7&m-------------------------" and "&fClick to get notifications for &a[VIP] &fAdvertisements" and "&7&m-------------------------" to run:
            timer("7m", player)
            close player's inventory
            set {lasttimer.%player%} to "VIP"
        format gui slot 2 of player with diamond block named "&b[PRO]" with lore "&7&m-------------------------" and "&fClick to get notifications for &b[PRO] &fAdvertisements" and "&7&m-------------------------" to run:
            timer("5m", player)
            close player's inventory
            set {lasttimer.%player%} to "MVP"
        format gui slot 4 of player with gold block named "&6[LEGEND]" with lore "&7&m-------------------------" and "&fClick to get notifications for &6[LEGEND] &fAdvertisements" and "&7&m-------------------------" to run:
            timer("2m", player)
            close player's inventory
            set {lasttimer.%player%} to "LEGEND"
        format gui slot 6 of player with lapis block named "&3[PATRON]" with lore "&7&m-------------------------" and "&fClick to get notifications for &3[PATRON] &fAdvertisements" and "&7&m-------------------------" to run:
            timer("1m", player)
            close player's inventory
            set {lasttimer.%player%} to "PATRON"
        format gui slot 8 of player with barrier named "&cCancel" to run:
            cancelTimer(player)

function timer(t: string, p: player):
    wait 2 ticks
    set {_time} to {_t}
    set {running.timer::%{_p}%} to true
    if {_time} contains "s":
        replace all "s" with " seconds" in {_time}
    else if {_time} contains "m":
        replace all "m" with " minutes" in {_time}
    send "&a%{lasttimer.%{_p}%}% &aTimer has started!" to {_p}
    set {_time} to ({_time} parsed as time)
    wait {_time} parsed as timespan
    if {canceled.%{_p}%} isn't set:
        send title "&7&m- &a&lAD TIMER &7&m-" to {_p} for 2 seconds
        wait 3 seconds
        send "&aTimer Over &7(/adalerts) &ato restart!" to {_p}
        delete {running.timer::%{_p}%}

function cancelTimer(p: player):
    if {running.timer::%{_p}%} is set:
        set {cancel.%{_p}%} to true
        send "&a%{lasttimer.%{_p}%}% &aTimer canceled" to {_p}
        delete {running.timer::%{_p}%}
    else:
        send "&cThere is no running timers for you!" to {_p}

 

Edited by Invislol

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

Any other skript Ideas?

 

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...