#DeluxeMenu JavaScript Requirements problem.

1 messages · Page 1 of 1 (latest)

lost shell
#
    click_requirement:
      requirements:
        permission:
          type: javascript
          expression: '%outpost_coins% >= 1000' 
      deny_commands:
        - "[message] &a&lGEM SHOP &a⊵ &7You don't have enough gems." 
    click_commands:
      - "[close]"
      - "[sound] ENTITY_FIREWORK_ROCKET_TWINKLE"
      - "[console] vkbackpack give %player_name% 1 &b&lAlcatraz Backpack"
      - "[console] outpost takecoins %player_name% 1000"
      - "[console] cmi titlemsg %player_name% &a&lGEM SHOP\n&7You bought a &bAlcatraz Backpack &7Congrats!"
      - "[message] &a&lGEM SHOP &a⊵ &7You bought a &bAlcatraz Backpack &7Congrats!"```

I've followed exactly the wiki why does it keep telling me I don't have enough gems? It says `<=` so greater than or equal so it should work properly because i have more than the required value because I have 1,000,000 gems
signal sluice
#

If the returned value by that placeholder is formatted with commas, dots, etc. it won't work.

lost shell
#

Oh

signal sluice
#

try expression: "'%outpost_coins%'.replace(/,/g, '') >= 1000"

lost shell
#

expression: '%outpost_coins%.replace(/,/, '') >= 1000' ?

#

Okay one sec

signal sluice
#

use " " around the expression

#

Ah and, add that g after /,/ to replace all commas

lost shell
#

For some reason i cant upload files/pictures or links here

regal apexBOT
lost shell
#

i got a huge error and i cant paste it

#

one sec

#
    click_requirement:
      requirements:
        permission:
          type: javascript
          expression: "%outpost_coins%.replace(/,/g, '') >= 1000"
      deny_commands:
        - "[message] &a&lGEM SHOP &a⊵ &7You don't have enough gems."
    click_commands:
      - "[close]"
      - "[sound] ENTITY_FIREWORK_ROCKET_TWINKLE"
      - "[console] vkbackpack give %player_name% 1 &b&lAlcatraz Backpack"
      - "[console] outpost takecoins %player_name% 1000"
      - "[console] cmi titlemsg %player_name% &a&lGEM SHOP\n&7You bought a &bAlcatraz Backpack &7Congrats!"
      - "[message] &a&lGEM SHOP &a⊵ &7You bought a &bAlcatraz Backpack &7Congrats!"  ```
#

I added the g and changed it to ""

signal sluice
#

Ah

idle thunder
#

you need to put %outpost_coins% in '' as well I believe

signal sluice
#

Yup, I just realized

signal sluice
#

And never send images of errors, is a pain to read off an image

lost shell
#

Working now

#

Thanks!

#

would appreciate if you include this to the wiki so future users wont have to deal with this

idle thunder