#HEY ! Is it possible to make a button clickable only 3 times per player, for a shop with deluxemanu

1 messages · Page 1 of 1 (latest)

inland pumice
#

?

sweet kelp
#

use luckmperms or mastercooldown

inland pumice
sweet kelp
#

you can get a list of cooldown if use mastercooldown

inland pumice
#

Okay thx

neat sigil
#

in addition to this, you could also try using the meta from deluxemenus to store the amount of times the individual clicked it

#

not sure if mastercooldowns will do much here, but luckperms also has meta

using luckperms permissions (ex: clicked.1, clicked.2, clicked.3) would also work, but a little messier

inland pumice
#

I want for example that a player can buy 3 times 5 power, once he buy them 3 times, he can no longer

neat sigil
#

use dm meta

#

i recommend

inland pumice
#

I can create 3 slots which each time gives a different permission but I do everything on a single slot

neat sigil
#

If you want to put them all in 1 slot I can do that for you if you send the menu over, or I can also show you how to use dm meta

inland pumice
#

And what is meta?

neat sigil
#

it's a value stored to the player's data

#

so you could have a meta named item1-purchased that stores how many items they purchased so far

#

Can you run a test for me by chance?

#

/dm execute <your_name> [meta] add ITEM1-PURCHASED INTEGER 1

#

type that, see if you get any errors
then type /papi parse me %deluxemenus_meta_ITEM1-PURCHASED_INTEGER_50%

inland pumice
#

Ok I'm going to look at all this, and I have another problem, sometimes when I click on a menu it does not open, and sometimes it opens

#

'close':
material: BARRIER
slot: 24
priority: 5
update: true
hide_attributes: true
display_name: "&cRetour au menu"
material: barrier
slot: 49
display_name: '&cRetour au menu'
click_commands:
- '[sound] ENTITY_SNOW_GOLEM_DEATH'
- '[close]'
- '[openguimenu] menu_menu'

neat sigil
#
item1:
  material: dirt
  slot: 0
  view_requirement: #view requirement, so the user can/cannot see the item
    requirements:
      meta:
        type: '!has meta'
        key: ITEM1-PURCHASED
        meta_type: INTEGER
        value:  3 # the max number of items the user can purchase
  click_requirement: #click requirement, so the user can/cannnot click the item
    requirements:
      meta:
        type: '!has meta'
        key: ITEM1-PURCHASED
        meta_type: INTEGER
        value:  3 # the max number of items the user can purchase
        deny_commands:
        - '[message] you already bought 3 of these!' # just in case they somehow see the item, already having bought 3
  click_commands:
  - '[meta] add ITEM1-PURCHASED INTEGER 1' #adds 1 to the amount of items purchased
  - '[close]'
#

@inland pumice this should work

#

well

neat sigil
neat sigil
#

fyi if you did want to stack your items in 1 slot you need to use view requirements and priorities

inland pumice
#

Yeah

inland pumice
neat sigil
#

idk if that is related

inland pumice
#

I try

neat sigil
#

also, unrelated, you have 2 display_names and 2 slots defined for htat item