Need Gui Script Shop Help

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

MotoXgamer

Member
Dec 30, 2020
3
0
1
24
I am creating my script for my shop in my Minecraft server (mine hut) and when i reload the script it says
"can't understand this condition: "player balance is greater than or is equal to 2000 run" (Shop.sk, line 5: if player balance is greater than or is equal to 2000 run:")"


this is the full script please help.

Code:
command /shop:
  trigger:
    open virtual chest inventory with size 3 named "shop" to player
    format gui slot 0 of player with Diamond named "1 Diamond &a$2000"
    if player balance is greater than or is equal to 2000 run:
      execute console command "/eco take 2000"
      execute console command "/give %player% Diamond 1"
      if else:
        send "&cYou Do Not Have Enough Money For This!"

BTW: i am new to this and have never written script before. i will attach all the plugins i have activated on this server Thank you!

upload_2020-12-29_20-57-57.png
 
i didn't look at the full code so i do not know if there are other errors, however you do not need run at the end of that line.
Code:
if player's balance is greater than or equal to 2000:
should suffice:>
 
i didn't look at the full code so i do not know if there are other errors, however you do not need run at the end of that line.
Code:
if player's balance is greater than or equal to 2000:
should suffice:>


After i reload the script with the new line of code there is a new thing that popped up>> "Can't compare "player balance" with an integer (Shop.sk, line 5: if player balance is greater than or equal to 2000:")"
 
After i reload the script with the new line of code there is a new thing that popped up>> "Can't compare "player balance" with an integer (Shop.sk, line 5: if player balance is greater than or equal to 2000:")"
You need to have player's balance, the 's is essential :emoji_slight_smile:
 
ok so i reloaded the script with this
Code:
command /shop:
  trigger:
    open virtual chest inventory with size 3 named "shop" to player
    format gui slot 0 of player with Diamond named "1 Diamond &a$2000"
    if player's balance is greater than or equal to 2000:
      execute console command "/eco take 2000"
      execute console command "/give %player% Diamond 1"
      if else:
        send "&cYou Do Not Have Enough Money For This!"

and now it says can't understand this condition: "else" (Shop.sk, line 8: if else:")"


Thank you for all your help and i have a feeling that this will be the last error message
 
im so sorry what xD i recommend looking at tutorials to learn basic skript.
if statements should go like this: (remember else if: is optional)
Code:
if:
    #code
else if: #optional
    #code
else:
    #code

In conclusion, you need to remove the `if` from `if else` and remove one indent from it and the proceeding lines
 
Status
Not open for further replies.