Help with a 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.

ImEnzo

Supporter
Jan 29, 2017
25
1
0
33
So yeah first hey :emoji_slight_smile: I was a long time inactive at the computer and I want to start with skript again! :emoji_wink:

What I need:
If someone with the permissions reward.admin use this command:

/reward-purchase-admin <player>:

and types in <player> the name of the player

that the command: /reward-purchase

is activated till someone uses /reward-purchase then it need to be reset till someone with permissions uses this command again: /reward-purchase-admin <player>

Sorry for my bad English if you got some questions what I mean feel free to ask.
And im happy about every help!
 
When you say "activated", what is getting activated? A simple way to check or set something as active or not is to set a variable to true/false.

code_language.skript:
command /reward-purchase-admin <player>:
    trigger:
        set {is.active.%player%::*} to true
 
  1. command /reward-purchase-admin <player>:
  2. trigger:
  3. set {is.active.%arg-1%::*} to true
Because if you just have the player then it wont do the player you want in the argument.
 
May I ask why "::*" ?
[doublepost=1513855642,1513854998][/doublepost]And it still dont work:

code_language.skript:
command /reward-purchase:
    trigger:
        if {is.active.%player%::*} true
            send "&7It worked!"
            set {is.active.%player%::*} to false


command /reward-purchase-admin <player>:
    trigger:
        set {is.active.%player%::*} to true
 
why "::*" ?
"::*" are Variable Lists, I don't think you need this.

And it still dont work:

code_language.skript:
command /reward-purchase:
    trigger:
        if {is.active.%arg 1%} is true:
            send "&7It worked!"
            wait a tick
            set {is.active.%arg 1%} to false
            stop
          if {is.active.%arg 1%} is false:
            send "It's not active" to executor
            stop
          else if {is.active.%arg 1%} is not set:
            send "It's not set" to executor
            stop
command /reward-purchase-admin [<player>]:
    trigger:
      if arg 1 is set:
        set {is.active.%arg 1%} to true
        stop
      else if arg 1 is not set:
        send "You have to write the name of a player" to executor
        stop
 
"::*" are Variable Lists, I don't think you need this.



code_language.skript:
command /reward-purchase:
    trigger:
        if {is.active.%arg 1%} is true:
            send "&7It worked!"
            wait a tick
            set {is.active.%arg 1%} to false
            stop
          if {is.active.%arg 1%} is false:
            send "It's not active" to executor
            stop
          else if {is.active.%arg 1%} is not set:
            send "It's not set" to executor
            stop
command /reward-purchase-admin [<player>]:
    trigger:
      if arg 1 is set:
        set {is.active.%arg 1%} to true
        stop
      else if arg 1 is not set:
        send "You have to write the name of a player" to executor
        stop

Thanks!
[doublepost=1513870088,1513865790][/doublepost]
"::*" are Variable Lists, I don't think you need this.



code_language.skript:
command /reward-purchase:
    trigger:
        if {is.active.%arg 1%} is true:
            send "&7It worked!"
            wait a tick
            set {is.active.%arg 1%} to false
            stop
          if {is.active.%arg 1%} is false:
            send "It's not active" to executor
            stop
          else if {is.active.%arg 1%} is not set:
            send "It's not set" to executor
            stop
command /reward-purchase-admin [<player>]:
    trigger:
      if arg 1 is set:
        set {is.active.%arg 1%} to true
        stop
      else if arg 1 is not set:
        send "You have to write the name of a player" to executor
        stop

It doesn't work it says this command doesn't have any arguments
 
Uhh, yeah, I got confused a bit, add [<player>] after "command /reward-purchase:"
Ehm, still not working, but btw why [<player>] after command /reward-purchase: I just want that someone uses the command "/reward-purchase" and gets the message "it worked" not "/reward-purchase Notch" only at the command "/reward-purchase-admin" must be player name behind the command because it needs to know by who the /reward-purchase command need to be activated.
 
Status
Not open for further replies.