Solved Yes or no command

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

FireRoz

Active Member
May 28, 2020
133
6
18
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:
command /staffannounce <text> <text>:
  permission: staff.announce
  usage: /staffannounce <Anonymously yes/no> <message>
  aliases: /sa
  permission message: &cYou're not allowed to use this command!
  trigger:
    if arg-1 is "yes":
    broadcast "&f"
    broadcast "&5&lStaff announcments&7: &f&l%arg-2%"
    broadcast "&f"
    if arg-1 is "no":
    broadcast "&f"
    broadcast "&c%player%&7: &f&l%arg-2%"
    broadcast "&f"
have a nice day
 
Code:
command /staffannounce <text> <text>:
  permission: staff.announce
  usage: /staffannounce <Anonymously yes/no> <message>
  aliases: /sa
  permission message: &cYou're not allowed to use this command!
  trigger:
    if arg-1 is "yes":
      broadcast "&f"
      broadcast "&5&lStaff announcments&7: &f&l%arg-2%"
      broadcast "&f"
    else if arg-1 is "no":
      broadcast "&f"
      broadcast "&c%player%&7: &f&l%arg-2%"
      broadcast "&f"
 
eh
Code:
command /staffannounce <text> <text>:
  permission: staff.announce
  usage: /staffannounce <Anonymously yes/no> <message>
  aliases: /sa
  permission message: &cYou're not allowed to use this command!
  trigger:
    if arg-1 is "yes":
      broadcast "&f"
      broadcast "&5&lStaff announcments&7: &f&l%arg-2%"
      broadcast "&f"
    else if arg-1 is "no":
      broadcast "&f"
      broadcast "&c%player%&7: &f&l%arg-2%"
      broadcast "&f"
ehhh I'm new to this ty lol
 
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
 
Last edited:
Status
Not open for further replies.