1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Random broadcast...

Discussion in 'Requests' started by bobby2002, Jan 31, 2018.

  1. bobby2002

    bobby2002 Well-Known Member

    Joined:
    Nov 24, 2017
    Messages:
    50
    Likes Received:
    0
    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
     
  2. Best Answer:
    Post #2 by Wynnevir, Feb 1, 2018
  3. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    974
    Likes Received:
    57
    I haven't tested this, so let me know if it works. It shouldn't need any addons.
    Code (Skript):
    1.  
    2. command /tipstop:
    3.     permission: tipstop.use
    4.     permission-message: "Oy, you ain't got permission"
    5.     trigger:
    6.         if {tipstop::%player%} is false:
    7.             set {tipstop::%player%} to true
    8.         else:
    9.             set {tipstop::%player%} to false
    10.          
    11. command /tip <text> <text>:
    12.     trigger:
    13.         if arg 1 is "add":
    14.             add arg 2 to {tiplist::*}
    15.             send "Tip added to the broadcast list!"
    16.         if arg 1 is "del":
    17.             remove arg 2 from {tiplist::*}
    18.             send "Tip removed from broadcast list!"
    19.          
    20. every 30 minutes:
    21.     loop all players:
    22.         if {tipstop::%player%} is not set:
    23.             set {tipstop::%player%} to false
    24.         if {tipstop::%player%} is false:
    25.             if loop-player has permission "tip.broadcast":
    26.                 set {_randotip} to a random element out of {tiplist::*}
    27.                 send "%{_randotip}%"
    28.  
    29.          
    30.  
     
  4. bobby2002

    bobby2002 Well-Known Member

    Joined:
    Nov 24, 2017
    Messages:
    50
    Likes Received:
    0
    upload_2018-2-2_17-36-8.png
    i got a few errors iv fixed some, but i dont know about these.
     
  5. White

    White Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    445
    Likes Received:
    25
    Simple fix, just replace player with loop-player
     
  6. bobby2002

    bobby2002 Well-Known Member

    Joined:
    Nov 24, 2017
    Messages:
    50
    Likes Received:
    0
    Thank you so much.☺️
     
Loading...