Solved Need some help on this new piece of skript.

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

BlueRival

Member
Jul 26, 2020
4
0
0
17
Hey i was trying to make a /sell command and it is going very wrong so far :emoji_slight_smile: i was wondering if anybody could help me out.

Code:
options:
  set {_stone} to number of stone in Player's inventory
  set {_value1} to {@Stone} * {_stone}

command /sell:
  trigger:
    if player has {_stone} stone:
      run "/eco give %player% {_value}"
    else:
      send "You dont have any stone"
 
First... options start with @
Code:
options:
    prefix: "I'm your prefix! :)"

command /test:
    trigger:
        send "{@prefix}"
Then, every variable that starts with _ is only gonna work in one command/function/...
Code:
command /test:
    trigger:
        set {_msg} to "Hi!"
        send "%{_msg}%"

command /test2:
    trigger:
        send "%{_msg}%" #output = "<none>" cause the variable was not set in this command
So you have to put your first 2 lines from options to your command :emoji_wink:
Code:
command /sell:
  trigger:
    set {_stone} to number of stone in Player's inventory
    set {_value} to 3 * {_stone}
    if {_stone} > 0:
      run "/eco give %player% {_value}"
    else:
      send "You dont have any stone"
 
Status
Not open for further replies.