Solved greater then error

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

Daan de Haan

Member
Sep 12, 2021
3
0
1
23
what am i doing wrong here?

command /blockshop:
trigger:
wait 3 ticks
open chest with 3 rows named "&a&lBlocks" to player
format slot 0 of player with grass block named "&a&lGrass Block" with lore "&7Price: &a&l$200" to close then run [execute player command "/buy grass_block"]

command /buy [<text>]:
trigger:
if arg 1 is "grass_block":
set {_playermoney} to balance of player
if {_playermoney} is more then 200
remove 200 from player's balance
add 16 grass block to player's inventory

upload_2021-9-18_15-38-34.png
 
I think its saying you need to indent your code
[doublepost=1631972656,1631972577][/doublepost]command /blockshop:
trigger:
wait 3 ticks
open chest with 3 rows named "&a&lBlocks" to player
format slot 0 of player with grass block named "&a&lGrass Block" with lore "&7Price: &a&l$200" to close then run [execute player command "/buy grass_block"]

command /buy [<text>]:
trigger:
if arg 1 is "grass_block":
set {_playermoney} to balance of player
if {_playermoney} is more then 200
remove 200 from player's balance
add 16 grass block to player's inventory
[doublepost=1631972801][/doublepost]wat? so confused my reply was indented in editor but not in reply? why?
 
= are spaces

command /blockshop:
==trigger:
====wait 3 ticks
====open chest with 3 rows named "&a&lBlocks" to player
====format slot 0 of player with grass block named "&a&lGrass Block" with lore "&7Price: &a&l$200" to close then run [execute player command "/buy grass_block"]

command /buy [<text>]:
==trigger:
====if arg 1 is "grass_block":
======set {_playermoney} to balance of player
======if {_playermoney} is more then 200
========remove 200 from player's balance
========add 16 grass block to player's inventory
[doublepost=1631973190,1631973153][/doublepost]oh yeah probally shouldant listen to me
 
what am i doing wrong here?

command /blockshop:
trigger:
wait 3 ticks
open chest with 3 rows named "&a&lBlocks" to player
format slot 0 of player with grass block named "&a&lGrass Block" with lore "&7Price: &a&l$200" to close then run [execute player command "/buy grass_block"]

command /buy [<text>]:
trigger:
if arg 1 is "grass_block":
set {_playermoney} to balance of player
if {_playermoney} is more then 200
remove 200 from player's balance
add 16 grass block to player's inventory

View attachment 6351
here, instead of "is more than" you need the greater than symbol (>)

Code:
command /blockshop:
  trigger:
    wait 3 ticks
    open chest with 3 rows named "&a&lBlocks" to player
    format slot 0 of player with grass block named "&a&lGrass Block" with lore "&7Price: &a&l$200" to close then run [execute player command "/buy grass_block"]

command /buy [<text>]:
  trigger:
    if arg 1 is "grass_block":
      set {_playermoney} to balance of player
      if {_playermoney} > 200:
        remove 200 from player's balance
        add 16 grass block to player's inventory
[doublepost=1632005487,1632004506][/doublepost]
it should look something like this:
notepad_3HgR5azWPl.png

[doublepost=1631973055,1631972946][/doublepost]sorry im not that good at skript I tried to help ):

code.png
 
There are many things wrong with this:
1. Why the delay after the command trigger
2. SkQuery GUIs? Hell nah → TuSKe, skript-gui or vanilla (vanilla is the best)
3. Why put the player's balance in a variable?
4. And I would not recommend to use "is more than" because if the player has exactly 200 it will not work, use:
Code:
if player's balance is more than or equal to 200:
 
Status
Not open for further replies.