Jump to content

Issues with GUI and buying.


Ikey

Recommended Posts

Hey, I have been having issues with GUI and Buying from it. I am trying to make a boss GUI that you can buy to fight. Here is the skript right now:

command /openboss:
   trigger:
      open virtual chest inventory with size 3 named "&c&lBoss" to player
      format gui slot 11 of player with diamond sword named "&c&lFight The Boss" with lore "&a&oThis will cost 50k" run:
      if {%player%bal} contains "50000":
      execute console command "/say &c&l%player% Is now fighting the Boss!"
      execute console command "/eco take %player% 50000"   
     else:
      send "&cYou need $50000 for that!"

anyone know whats wrong? please help me

Owner of ikeysurviv.minehut.gg

 

⊱------------------------------⊰

[LEGEND] on Minehut

⊱------------------------------⊰

In-game name - ikeyIX

Discord name - ikeyIX#2007

Link to comment
Share on other sites

the indents and its to run not just run. Also you can just do broadcast " " to broadcast a message instead of just executing a custom console command. And you can also do remove 50000 from player's balance too instead of executing a console command. And that if statement is wrong. That money variable should be a number and make it if {%player%bal} >= 50000. Also you should change the variable to {bal::%player's uuid%} instead. 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

It is now saying

"Cant compare 'if {%player%bal}' with an integer (bossgui.sk, line 5: if {%player%bal} <=50000')" and "Cant understand this condition/effect: if {%player%bal} =< 50000 (bossgui.sk, line 8: if {%player%bal} =< 50000')"

Here is my skript so far:

command /openboss:
   trigger:
      open virtual chest inventory with size 3 named "&c&lBoss" to player
      format gui slot 11 of player with netherite sword named "&c&lFight The Boss" with lore "&a&oThis will cost 50k" to run:
         if {%player%bal} >= 50000
         execute console command "/say &c&l%player% Is now fighting the Boss!"
         execute console command "/eco take %player% 50000"   
          if {%player%bal} =< 50000
         send "&cYou need $50000 for that!"
Can anyone help me?

Edited by ikey

Owner of ikeysurviv.minehut.gg

 

⊱------------------------------⊰

[LEGEND] on Minehut

⊱------------------------------⊰

In-game name - ikeyIX

Discord name - ikeyIX#2007

Link to comment
Share on other sites

 

12 hours ago, ikey said:

It is now saying

"Cant compare 'if {%player%bal}' with an integer (bossgui.sk, line 5: if {%player%bal} <=50000')" and "Cant understand this condition/effect: if {%player%bal} =< 50000 (bossgui.sk, line 8: if {%player%bal} =< 50000')"

Here is my skript so far:

command /openboss:
   trigger:
      open virtual chest inventory with size 3 named "&c&lBoss" to player
      format gui slot 11 of player with netherite sword named "&c&lFight The Boss" with lore "&a&oThis will cost 50k" to run:
         if {%player%bal} >= 50000
         execute console command "/say &c&l%player% Is now fighting the Boss!"
         execute console command "/eco take %player% 50000"   
          if {%player%bal} =< 50000
         send "&cYou need $50000 for that!"
Can anyone help me?

you forgot a : after the if statements and you need to indent correctly 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

All of the indenting worked successfully but the right clicking of the sword is not working also when ever I execute the command it says in chat "An internal error occurred while attempting to preform this command." also the ${%player%bal}" is not working on line 11.

Here is my skript:

command /openboss:
   trigger:
      open virtual chest inventory with size 3 named "&c&lBoss" to player
      format gui slot 11 of player with netherite sword named "&c&lFight The Boss" with lore "&a&oThis will cost 50k" to run:
         if {%player%bal} >= 50000:
            execute console command "/say &c&l%player% Is now fighting the Boss!"
            execute console command "/eco take %player% 50000"   
         if {%player%bal} is less than 50000:
            send "&cYou need $50000 for that!" to player
      format gui slot 15 of player with sunflower named "&aYou have $${%player%bal}""
      format gui slot 0 of player with black stained glass pane
      format gui slot 1 of player with black stained glass pane
      format gui slot 2 of player with black stained glass pane
      format gui slot 3 of player with black stained glass pane
      format gui slot 4 of player with black stained glass pane
      format gui slot 5 of player with black stained glass pane
      format gui slot 6 of player with black stained glass pane
      format gui slot 7 of player with black stained glass pane
      format gui slot 8 of player with black stained glass pane
      format gui slot 18 of player with black stained glass pane
      format gui slot 19 of player with black stained glass pane
      format gui slot 20 of player with black stained glass pane
      format gui slot 21 of player with black stained glass pane
      format gui slot 22 of player with black stained glass pane
      format gui slot 23 of player with black stained glass pane
      format gui slot 24 of player with black stained glass pane
      format gui slot 25 of player with black stained glass pane
      format gui slot 26 of player with black stained glass pane

Owner of ikeysurviv.minehut.gg

 

⊱------------------------------⊰

[LEGEND] on Minehut

⊱------------------------------⊰

In-game name - ikeyIX

Discord name - ikeyIX#2007

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...