A
Admincraftā€¢2y ago
xer0

how to add requirements?

this is an example I saw on how they work but its not working. players are able to puchase the item without needing money or votes
left_click_requirement: expression: '%vault_eco_balance% > 10000' expression: '%VotingPlugin_alltimetotal% > 20'
113 Replies
ProGamingDk
ProGamingDkā€¢2y ago
u forgot to add type -.- also do >= not just >
xer0
xer0OPā€¢2y ago
thank you. where would I add type?
ProGamingDk
ProGamingDkā€¢2y ago
šŸ˜„
Lunaiskey
Lunaiskeyā€¢2y ago
legit deluxemenus has a wiki
xer0
xer0OPā€¢2y ago
i seen the wiki i was just confused about how requirements work soz
ProGamingDk
ProGamingDkā€¢2y ago
you would have seen type: javascript but its fine just read it for next time,
xer0
xer0OPā€¢2y ago
it says type: TYPE in wiki so I would replace that with? javascript?
ProGamingDk
ProGamingDkā€¢2y ago
yes as the example shows
xer0
xer0OPā€¢2y ago
my bad I clicked on mavins link and it took me to the top of the wiki page maven
Lunaiskey
Lunaiskeyā€¢2y ago
left_click_requirement:
req1:
type: >=
input: %vault_eco_balance%
output: 10000
req2:
type: >=
input: %votingplugin_alltimetotal%
output: 20
left_click_requirement:
req1:
type: >=
input: %vault_eco_balance%
output: 10000
req2:
type: >=
input: %votingplugin_alltimetotal%
output: 20
xer0
xer0OPā€¢2y ago
i understand now thanks guys oh type: javascript expression: '%vault_eco_balance% >= 100' this would work too ?
Lunaiskey
Lunaiskeyā€¢2y ago
yes just make sure that each requirement has its own id
xer0
xer0OPā€¢2y ago
okay tyty you guys are awesome
Lunaiskey
Lunaiskeyā€¢2y ago
left_click_requirements:
<id>: //has to be unique
type: ...
left_click_requirements:
<id>: //has to be unique
type: ...
xer0
xer0OPā€¢2y ago
okay i see i can basically name it whatever i want correct?
Lunaiskey
Lunaiskeyā€¢2y ago
yeah
xer0
xer0OPā€¢2y ago
they just have to be different names
Lunaiskey
Lunaiskeyā€¢2y ago
as long as its just one word so no spaces in it if you want spaces then use something like underscore _
xer0
xer0OPā€¢2y ago
okay so its still not working for some reason
Lunaiskey
Lunaiskeyā€¢2y ago
you gave it left click commands right?
xer0
xer0OPā€¢2y ago
yes
left_click_commands:
- '[console] eco take %player_name% 5000'
- '[console] lp user %player_name% parent add Member'
- '[message] &a(!) You have successfully purchased the &#caf1ff[Member] &r&arank!'
- '[console] cc give physical %player% %random%'
- '[console] adjustbonusclaimblocks 500 %player_name%'
left_click_commands:
- '[console] eco take %player_name% 5000'
- '[console] lp user %player_name% parent add Member'
- '[message] &a(!) You have successfully purchased the &#caf1ff[Member] &r&arank!'
- '[console] cc give physical %player% %random%'
- '[console] adjustbonusclaimblocks 500 %player_name%'
ProGamingDk
ProGamingDkā€¢2y ago
use ` not '
Lunaiskey
Lunaiskeyā€¢2y ago
what the
xer0
xer0OPā€¢2y ago
i had to switch keyboards for a sec my main one doesnt have that key lol
Lunaiskey
Lunaiskeyā€¢2y ago
theres a quote next to leftclick commands also when you say it doesnt work, which way
xer0
xer0OPā€¢2y ago
[11:13:06 INFO]: [Essentials] CONSOLE issued server command: /eco take xxerr0 25000
[11:13:06 INFO]: Error: The minimum balance a user can have is $0.
[11:13:06 INFO]: [Essentials] CONSOLE issued server command: /eco take xxerr0 25000
[11:13:06 INFO]: Error: The minimum balance a user can have is $0.
ProGamingDk
ProGamingDkā€¢2y ago
-.- well that means its working oh wait the requirement isnt
xer0
xer0OPā€¢2y ago
the permission isnt working
ProGamingDk
ProGamingDkā€¢2y ago
but wheres the requirement here
xer0
xer0OPā€¢2y ago
and the requirement i have 0$ and im able to purchase any rank
left_click_requirement:
req1:
type: javascript
input: "%vault_eco_balance%"
output: "5000"
req2:
type: javascript
input: "%votingplugin_alltimetotal%"
output: "10"
left_click_requirement:
req1:
type: javascript
input: "%vault_eco_balance%"
output: "5000"
req2:
type: javascript
input: "%votingplugin_alltimetotal%"
output: "10"
Lunaiskey
Lunaiskeyā€¢2y ago
first make sure you arent op and dont have the * permission are you fucking kidding me
xer0
xer0OPā€¢2y ago
i did what... oh
Lunaiskey
Lunaiskeyā€¢2y ago
i spoonfed you the answer you legit asked if this one was also correct how did you end up splicing the two together? type javascript requires an expression, which you showed that you understood
xer0
xer0OPā€¢2y ago
I took the string equals format because it looked like the format you gave me but since its javascript I need to use ' ' right?
Lunaiskey
Lunaiskeyā€¢2y ago
No description
xer0
xer0OPā€¢2y ago
I mixed them together is what happened
Lunaiskey
Lunaiskeyā€¢2y ago
yes which is why it doesnt work
xer0
xer0OPā€¢2y ago
im learning :cat:
Lunaiskey
Lunaiskeyā€¢2y ago
theres a difference between learning and being blind
xer0
xer0OPā€¢2y ago
i am pretty blind so that could be a reason too so one question though what do string equals do?
Lunaiskey
Lunaiskeyā€¢2y ago
the wiki legit tells you what it does
No description
Lunaiskey
Lunaiskeyā€¢2y ago
string equals string text equals text exactly
xer0
xer0OPā€¢2y ago
hm i dont understand but its okay javascript is what I need to use anyways okay..its still not working..
left_click_requirement:
req1:
type: javascript
input: '%vault_eco_balance%'
output: '5000'
req2:
type: javascript
input: '%votingplugin_alltimetotal%'
output: '10'
left_click_requirement:
req1:
type: javascript
input: '%vault_eco_balance%'
output: '5000'
req2:
type: javascript
input: '%votingplugin_alltimetotal%'
output: '10'
[11:36:55 INFO]: [Essentials] CONSOLE issued server command: /eco take xxerr0 135000
[11:36:55 INFO]: Error: The minimum balance a user can have is $0.
[11:36:55 INFO]: /AdjustBonusClaimBlocks <player> <amount>
[11:36:55 INFO]: [Essentials] CONSOLE issued server command: /eco take xxerr0 135000
[11:36:55 INFO]: Error: The minimum balance a user can have is $0.
[11:36:55 INFO]: /AdjustBonusClaimBlocks <player> <amount>
Lunaiskey
Lunaiskeyā€¢2y ago
No description
Lunaiskey
Lunaiskeyā€¢2y ago
you could legit get that to work by replacing the word javascript with >= and remove the quotes from both input and output
xer0
xer0OPā€¢2y ago
okay
req1:
type: >=
input: '%vault_eco_balance%'
output: '5000'
req1:
type: >=
input: '%vault_eco_balance%'
output: '5000'
?
Lunaiskey
Lunaiskeyā€¢2y ago
...
xer0
xer0OPā€¢2y ago
so I cant use the format you gave me I have to use that format that is the example.?
Lunaiskey
Lunaiskeyā€¢2y ago
req1:
type: >=
input: %vault_eco_balance%
output: 5000
req1:
type: >=
input: %vault_eco_balance%
output: 5000
remove the quotes from input and output
xer0
xer0OPā€¢2y ago
i will try it
Lunaiskey
Lunaiskeyā€¢2y ago
do the same for both requirements
xer0
xer0OPā€¢2y ago
I did and still the same thing im able to purchase the rank without having money
Lunaiskey
Lunaiskeyā€¢2y ago
post the full item
xer0
xer0OPā€¢2y ago
items:
'1':
material: KNOWLEDGE_BOOK
amount: 1
slot: 10
display_name: '&#caf1ff&l[Member]'
open_requirement:
requirements:
upgrades:
type: has permission
permission: rank.default
output: true
lore:
- '&r'
- '&fPerks:'
- '&#caf1ff*&f 3 total Market listings'
- '&#caf1ff*&f 3 total Homes'
- '&#caf1ff*&f 500 free claim blocks'
- '&#caf1ff*&f 1 Random crate key'
- '&#caf1ff*&f &#caf1ff[Member]&f Prefix'
- '&r'
- '&7Cost: &#ffb000$5,000 &f+&#ffb000 10 votes'
- '&r'
- '&7&lāž”&7 Click to purchase'
left_click_commands:
- '[console] eco take %player_name% 5000'
- '[console] lp user %player_name% parent add Member'
- '[message] &a(!) You have successfully purchased the &#caf1ff[Member] &r&arank!'
- '[console] cc give physical %player% %random%'
- '[console] adjustbonusclaimblocks 500 %player_name%'
left_click_requirement:
req1:
type: >=
input: %vault_eco_balance%
output: 5000
req2:
type: >=
input: %votingplugin_alltimetotal%
output: 10
items:
'1':
material: KNOWLEDGE_BOOK
amount: 1
slot: 10
display_name: '&#caf1ff&l[Member]'
open_requirement:
requirements:
upgrades:
type: has permission
permission: rank.default
output: true
lore:
- '&r'
- '&fPerks:'
- '&#caf1ff*&f 3 total Market listings'
- '&#caf1ff*&f 3 total Homes'
- '&#caf1ff*&f 500 free claim blocks'
- '&#caf1ff*&f 1 Random crate key'
- '&#caf1ff*&f &#caf1ff[Member]&f Prefix'
- '&r'
- '&7Cost: &#ffb000$5,000 &f+&#ffb000 10 votes'
- '&r'
- '&7&lāž”&7 Click to purchase'
left_click_commands:
- '[console] eco take %player_name% 5000'
- '[console] lp user %player_name% parent add Member'
- '[message] &a(!) You have successfully purchased the &#caf1ff[Member] &r&arank!'
- '[console] cc give physical %player% %random%'
- '[console] adjustbonusclaimblocks 500 %player_name%'
left_click_requirement:
req1:
type: >=
input: %vault_eco_balance%
output: 5000
req2:
type: >=
input: %votingplugin_alltimetotal%
output: 10
Lunaiskey
Lunaiskeyā€¢2y ago
i hate my life
left_click_requirement:
requirements:
req1:
type: >=
input: %vault_eco_balance%
output: 5000
req2:
type: >=
input: %votingplugin_alltimetotal%
output: 10
left_click_requirement:
requirements:
req1:
type: >=
input: %vault_eco_balance%
output: 5000
req2:
type: >=
input: %votingplugin_alltimetotal%
output: 10
xer0
xer0OPā€¢2y ago
what?
ProGamingDk
ProGamingDkā€¢2y ago
he forgot requirements:
Lunaiskey
Lunaiskeyā€¢2y ago
yeah
xer0
xer0OPā€¢2y ago
wym?
Lunaiskey
Lunaiskeyā€¢2y ago
i forgot the requirements: between left_click_requirement: and the actual requirements see here
xer0
xer0OPā€¢2y ago
oh okay so I need to add in requirements:
Lunaiskey
Lunaiskeyā€¢2y ago
yes
ProGamingDk
ProGamingDkā€¢2y ago
remember to keep valid formatting
xer0
xer0OPā€¢2y ago
let me restart my server maybe its bugged because its not working still
Lunaiskey
Lunaiskeyā€¢2y ago
id just delete the server and give up at this point
xer0
xer0OPā€¢2y ago
left_click_requirement:
requirements:
req1:
type: >=
input: %vault_eco_balance%
output: 5000
req2:
type: >=
input: %votingplugin_alltimetotal%
output: 10
left_click_requirement:
requirements:
req1:
type: >=
input: %vault_eco_balance%
output: 5000
req2:
type: >=
input: %votingplugin_alltimetotal%
output: 10
so now the /ranks is broken I cant pull up the menu
Lunaiskey
Lunaiskeyā€¢2y ago
well what does console say about it?
xer0
xer0OPā€¢2y ago
[11:59:47 ERROR]: [DeluxeMenus] Detected invalid configuration in file: ranks.yml
[11:59:47 WARN]: [DeluxeMenus] Menu: Ranks in file: ranks.yml not loaded.
[11:59:47 ERROR]: [DeluxeMenus] Detected invalid configuration in file: ranks.yml
[11:59:47 WARN]: [DeluxeMenus] Menu: Ranks in file: ranks.yml not loaded.
Lunaiskey
Lunaiskeyā€¢2y ago
and it doesnt say anything else but that?
xer0
xer0OPā€¢2y ago
correct
Lunaiskey
Lunaiskeyā€¢2y ago
post the full thing to https://paste.helpch.at/
Lunaiskey
Lunaiskeyā€¢2y ago
i ment the menu
xer0
xer0OPā€¢2y ago
oh my bad the full menu? or just the items
Lunaiskey
Lunaiskeyā€¢2y ago
menu
xer0
xer0OPā€¢2y ago
ok https://paste.helpch.at/itagoneves.lua it broke after I added in the requirement: ive been working on '1'
ERROR:

while scanning a block scalar
in "<unicode string>", line 43, column 16:
type: >=
^
expected chomping or indentation indicators, but found '='
in "<unicode string>", line 43, column 17:
type: >=
^
ERROR:

while scanning a block scalar
in "<unicode string>", line 43, column 16:
type: >=
^
expected chomping or indentation indicators, but found '='
in "<unicode string>", line 43, column 17:
type: >=
^
I pasted the menu into yaml parser and this is the error it threw
Lunaiskey
Lunaiskeyā€¢2y ago
left_click_requirement:
requirements:
req1:
type: ">="
input: "%vault_eco_balance%"
output: 5000
req2:
type: ">="
input: "%votingplugin_alltimetotal%"
output: 10
left_click_requirement:
requirements:
req1:
type: ">="
input: "%vault_eco_balance%"
output: 5000
req2:
type: ">="
input: "%votingplugin_alltimetotal%"
output: 10
went and had a quick look at one of the example menus why the fuck doesnt the wiki tell you they have to be in quotes
xer0
xer0OPā€¢2y ago
no worries. I went ahead and just formatted it back to type: javascript to get it to work rq and im still able to purchase any ranks im so confused bro it should be working?
Lunaiskey
Lunaiskeyā€¢2y ago
ig go join helpchat and ask there cus i cba to try to troubleshoot it more
xer0
xer0OPā€¢2y ago
yeah i understand thanks for trying to help. you guys really need a donate section id be happy to
ProGamingDk
ProGamingDkā€¢2y ago
we are all independent ;D some of us do commisions for stuff tho
xer0
xer0OPā€¢2y ago
thats good cuz you guys do a lot and reply a lot faster helpchat
[12:25:00 INFO]: [Essentials] CONSOLE issued server command: /eco take xxerr0 100000
[12:25:00 INFO]: Error: The minimum balance a user can have is $0.
[12:25:00 INFO]: /AdjustBonusClaimBlocks <player> <amount>
[12:25:00 INFO]: [Essentials] CONSOLE issued server command: /eco take xxerr0 100000
[12:25:00 INFO]: Error: The minimum balance a user can have is $0.
[12:25:00 INFO]: /AdjustBonusClaimBlocks <player> <amount>
one last thing why would it be throwing this in console when I purchase the rank?
ProGamingDk
ProGamingDkā€¢2y ago
which part? the last part?
xer0
xer0OPā€¢2y ago
Error:
ProGamingDk
ProGamingDkā€¢2y ago
because ur using the wrong placeholder for player in that adjustclaimblocks because u cant have less than 0 dollars?
xer0
xer0OPā€¢2y ago
oh duh
ProGamingDk
ProGamingDkā€¢2y ago
lol (well essentials does have something called debt) but eh
xer0
xer0OPā€¢2y ago
so the adjustclaimblocks is also the wrong placeholder to give players more claim blocks?
Lunaiskey
Lunaiskeyā€¢2y ago
if your only testing the first item why is it attempting to remove 100000
xer0
xer0OPā€¢2y ago
not a fan personal fan of it either
Lunaiskey
Lunaiskeyā€¢2y ago
when the first item is 5000
xer0
xer0OPā€¢2y ago
i tested it on all the ranks
ProGamingDk
ProGamingDkā€¢2y ago
well its easy to disable like 2 seconds to disable
xer0
xer0OPā€¢2y ago
i disabled a while ago im gonna try to test it on my main server since I have the ranks setup. I hope thats not what it is..
ProGamingDk
ProGamingDkā€¢2y ago
you have downloaded the vault extension right? and the votingplugin one
xer0
xer0OPā€¢2y ago
yes yes my test server i dont have the ranks setup though so idk maybe that why im able to purchase them
25.06 17:41:50 [Server] WARN [DeluxeMenus] Javascript requirement at path: items.1.left_click_requirement.requirements.req1 does not contain an expression: entry
25.06 17:41:50 [Server] WARN [DeluxeMenus] Javascript requirement at path: items.1.left_click_requirement.requirements.req2 does not contain an expression: entry
25.06 17:41:50 [Server] WARN [DeluxeMenus] Javascript requirement at path: items.1.left_click_requirement.requirements.req1 does not contain an expression: entry
25.06 17:41:50 [Server] WARN [DeluxeMenus] Javascript requirement at path: items.1.left_click_requirement.requirements.req2 does not contain an expression: entry
this is what happens in console on my main server now same config as the one we've been working on this shows up when I do /dm reload ill quit bothering you guys about it I know your busy helping others. I appreciate the support from both of you. Im gonna take it over to Helpchat now
ProGamingDk
ProGamingDkā€¢2y ago
did u ever try just this?
Lunaiskey
Lunaiskeyā€¢2y ago
tbh i just setup a test menu and requirements just dont work at all
menu_title: "test"
open_command: testmenu
register_command: true
items:
"1":
material: STONE
slot: 0
left_click_requirements:
deny_commands:
- "[message] Failed"
requirements:
req1:
type: has money
amount: 5000
left_click_commands:
- "[message] Success"

menu_title: "test"
open_command: testmenu
register_command: true
items:
"1":
material: STONE
slot: 0
left_click_requirements:
deny_commands:
- "[message] Failed"
requirements:
req1:
type: has money
amount: 5000
left_click_commands:
- "[message] Success"

ProGamingDk
ProGamingDkā€¢2y ago
they have worked fine for me in the past weird
Lunaiskey
Lunaiskeyā€¢2y ago
im not sure if its just the deluxemenus version im using imma try 1.14.0 dev builds and see if it fails aswell or not nope it just doesnt work its starting to really piss me off aswell
xer0
xer0OPā€¢2y ago
so I got in contact with some and he told me to use this format
type: javascript
expression: '%vault_eco_balance% >= 100'
type: javascript
expression: '%vault_eco_balance% >= 100'
ProGamingDk
ProGamingDkā€¢2y ago
thats what i told u to do at the start -.-
xer0
xer0OPā€¢2y ago
ikik i liked mavens format better though and he did tell me it would work :3
ProGamingDk
ProGamingDkā€¢2y ago
No description
ProGamingDk
ProGamingDkā€¢2y ago
"this would work too?" yes but yeah not sure why he even gave the other example when docs says to do this
Lunaiskey
Lunaiskeyā€¢2y ago
hm i got it to work im dense, added an s on the end of left_click_requirement
xer0
xer0OPā€¢2y ago
if this works
Lunaiskey
Lunaiskeyā€¢2y ago
this works
menu_title: "test"
open_command: testmenu
register_command: true
items:
"1":
material: STONE
slot: 0
left_click_commands:
- "[message] Success"
left_click_requirement:
requirements:
req1:
type: ">="
input: "%vault_eco_balance%"
output: 5000
deny_commands:
- "[message] Failed"

menu_title: "test"
open_command: testmenu
register_command: true
items:
"1":
material: STONE
slot: 0
left_click_commands:
- "[message] Success"
left_click_requirement:
requirements:
req1:
type: ">="
input: "%vault_eco_balance%"
output: 5000
deny_commands:
- "[message] Failed"

xer0
xer0OPā€¢2y ago
okay one sec it works :meow: thank you thank you thank you
ProGamingDk
ProGamingDkā€¢2y ago
np

Did you find this page helpful?