Solved Random broadcast...

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

bobby2002

Active Member
Nov 24, 2017
50
0
0
21
Category: chat

Suggested name: random broadcast

What I want:
So I was thinking about every 30 minutes [can be changed] it broadcast random tips for the whole server. But when a play does a command that person doesn’t see the messages again, until they do the same command.

Ideas for commands:
/tipstop
Ideas for permissions:
Tipstop.broadcast
When I'd like it by: A reasonable time
 
I haven't tested this, so let me know if it works. It shouldn't need any addons.
code_language.skript:
command /tipstop:
    permission: tipstop.use
    permission-message: "Oy, you ain't got permission"
    trigger:
        if {tipstop::%player%} is false:
            set {tipstop::%player%} to true
        else:
            set {tipstop::%player%} to false
          
command /tip <text> <text>:
    trigger:
        if arg 1 is "add":
            add arg 2 to {tiplist::*}
            send "Tip added to the broadcast list!"
        if arg 1 is "del":
            remove arg 2 from {tiplist::*}
            send "Tip removed from broadcast list!"
          
every 30 minutes:
    loop all players:
        if {tipstop::%player%} is not set:
            set {tipstop::%player%} to false
        if {tipstop::%player%} is false:
            if loop-player has permission "tip.broadcast":
                set {_randotip} to a random element out of {tiplist::*}
                send "%{_randotip}%"
 
upload_2018-2-2_17-36-8.png

i got a few errors iv fixed some, but i dont know about these.