#Deny being brought again

1 messages · Page 1 of 1 (latest)

formal siren
#

How to i make this so once brought, it can not be brought again by a player to avoid buying the same upgrade twice by mistake?

frank depot
#

Copy from #general-plugins

in the open commands add

- "[meta] set BoughtUpgrade BOOLEAN %deluxemenus_meta_BoughtUpgrade_BOOLEAN_false%"

Then in the item

      requirements:
        BoughtUpgrade:
          type: has meta
          key: BoughtUpgrade
          meta_type: BOOLEAN
          value: false
          deny_commands:
          - "[message] &cYou have already bought this upgrade!"
#

And lastly add

- "[meta] set BoughtUpgrade BOOLEAN true"
``` in the click commands
formal siren
#

im doing something wrong here

frank depot
#

It still allows you to buy multiple times?

formal siren
#

i gave my alt 1 mill to buy

frank depot
#

Try aligning the second deny_commands with amount

formal siren
#

how so,

#

sorry new to this type of configuration for dm

frank depot
#
has_money:
  type: has money
  amount: 1000000
  deny_commands:
  - "[message] &cYou don't have enough money for this!"
#

just add two spaces before deny commands and the line below

formal siren
#

now it just say idont have enough money

#

sorry no

#

it say i already brought this upgrade

frank depot
#

alright can you do /papi parse me %deluxemenus_meta_BoughtUpgrade_BOOLEAN_false%

formal siren
#

done

frank depot
#

what does it say?

formal siren
#

false

frank depot
#

Can you send me the menu?

#

?paste

jade elbowBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

formal siren
#

this is on my test server btw before i implement into main

frank depot
formal siren
#

she works

frank depot
#

Great! glad it works now

formal siren
#

thanks mate!!

#

now i gotta go understand what all that means so i can implement it in other aspects later on

#

lol

frank depot
#

Np, basically the open command is making sure the BoughtUpgrade value is not null, so it's either true or false. The rest is just checking if it's false, it runs the deny command (so it's true, which means you've bought it)

formal siren
#

nice thanks, yeah i tried to buy it again and told me i already brought it.

frank depot
#

You can also do

        BoughtUpgrade:
          type: has meta
          key: BoughtUpgrade
          meta_type: BOOLEAN
          value: true
          success_commands:
          - "[message] &cYou have already bought this upgrade!"

which is probably easier to read and understand. This way the open command isn't even necessary I think

formal siren
#

so not value false

#

ah i see

frank depot
#

value: false
deny_commands

is the same as

value: true
success_commands

formal siren
#

just the same but reverse

frank depot
#

yep

formal siren
#

nice

#

the true way gives the dont have money for this

#

instead of already brought message

#

the other way is good for now

#

i can do some more reading and understand a bit better

#

appreciate the help

frank depot
#

np

formal siren
#

what about if i wanted to turn the brought upgrade to stone once its brought so its not even an option

#

or something along those lines

frank depot
formal siren
#

is it suppose to allign with left click commands

#

nothing different

astral spear
#

@formal siren I don't have time to read the entire conversation but can you please make a summary of all that happened? Basically I want to know what your current menu is, how the menu is supposed to work and how it actually works.

frank depot
formal siren
frank depot
formal siren
#

Sweet I’ll check it out after work thanks

formal siren
#

how do i make id so if they click on something in the GUI it will give them a link to go somewhere on the web, like a webstore ?

formal siren
#

like i want once they click on say a rank in the gui it pops up like this

formal siren
torpid bolt
# formal siren

this is a example

[minimessage] <click:open_url:https://your.link/>Click here
frank depot