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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Solved Yes or no command

Discussion in 'Skript' started by FireRoz, Oct 22, 2020.

Thread Status:
Not open for further replies.
  1. FireRoz

    FireRoz Active Member

    Joined:
    May 28, 2020
    Messages:
    134
    Likes Received:
    5
    Hey
    I'm trying to make a command which staff can announce if there are issues or whatever they want.
    I wanted to add a feature that lets the staff be anonymous, which means it could be like that:

    StaffMemberName: I'm hosting an event at my warp come join for prize.

    or it could be

    AnonymousStaff: we're experiencing some issues warp fps is now closed.

    Here's my code:
    Code (Text):
    1. command /staffannounce <text> <text>:
    2.   permission: staff.announce
    3.   usage: /staffannounce <Anonymously yes/no> <message>
    4.   aliases: /sa
    5.   permission message: &cYou're not allowed to use this command!
    6.   trigger:
    7.     if arg-1 is "yes":
    8.     broadcast "&f"
    9.     broadcast "&5&lStaff announcments&7: &f&l%arg-2%"
    10.     broadcast "&f"
    11.     if arg-1 is "no":
    12.     broadcast "&f"
    13.     broadcast "&c%player%&7: &f&l%arg-2%"
    14.     broadcast "&f"
    15.  
    have a nice day
     
  2. Best Answer:
    Post #2 by Time4Games, Oct 22, 2020
  3. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    196
    Likes Received:
    4
    Code (Text):
    1. command /staffannounce <text> <text>:
    2.   permission: staff.announce
    3.   usage: /staffannounce <Anonymously yes/no> <message>
    4.   aliases: /sa
    5.   permission message: &cYou're not allowed to use this command!
    6.   trigger:
    7.     if arg-1 is "yes":
    8.       broadcast "&f"
    9.       broadcast "&5&lStaff announcments&7: &f&l%arg-2%"
    10.       broadcast "&f"
    11.     else if arg-1 is "no":
    12.       broadcast "&f"
    13.       broadcast "&c%player%&7: &f&l%arg-2%"
    14.       broadcast "&f"
     
  4. FireRoz

    FireRoz Active Member

    Joined:
    May 28, 2020
    Messages:
    134
    Likes Received:
    5
    eh
    ehhh I'm new to this ty lol
     
  5. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    196
    Likes Received:
    4
    np :emoji_grinning:
     
    #4 Time4Games, Oct 22, 2020
    Last edited: Oct 22, 2020
  6. acai

    acai Active Member

    Joined:
    Oct 23, 2020
    Messages:
    89
    Likes Received:
    1
    As Time4Games wrote, yes, if or else commands require indentation of that type and "else if" before effects. (new line and 2 spaces for basically every trigger that ends with a colon)
    thanks for solving it before me, time4games
     
    #5 acai, Nov 17, 2020
    Last edited: Dec 3, 2020
Thread Status:
Not open for further replies.

Share This Page

Loading...