#Help with Perks-GUI

1 messages · Page 1 of 1 (latest)

reef flume
#

How can i make a Toggle-Button for the Perks to activate/deactivate? This is a Part of my Code: " 'noperm1': material: BARRIER slot: 19 display_name: '&4Nicht Freigeschaltet' lore: [] priority: 0 update: false click_commands: []" and i want to have a toggle button with lime and gray dye for the same slot...

worthy flower
#

Use view_quirements and priority

reef flume
#

But how exactly?

#

Heres my code

#

menu_title: '&a&lNeo&2&lCB&r&7 » &8Perks'
open_command:

  • perks2
    open_commands:
    size: 54

items:
'noperm1':
material: BARRIER
slot: 19
display_name: '&4Nicht Freigeschaltet'
lore: []
priority: 0
update: false
click_commands: []

'noperm2':
material: BARRIER
slot: 20
display_name: '&4Nicht Freigeschaltet'
lore: []
priority: 0
update: false
click_commands: []

'noperm3':
material: BARRIER
slot: 21
display_name: '&4Nicht Freigeschaltet'
lore: []
priority: 0
update: false
click_commands: []

'noperm4':
material: BARRIER
slot: 22
display_name: '&4Nicht Freigeschaltet'
lore: []
priority: 0
update: false
click_commands: []

'inventar_drop':
material: CHEST
slot: 10
display_name: '&bInventar-Drop'
lore:
priority: 1
update: false
click_commands: []

'doppelte_drops':
material: ROTTEN_FLESH
slot: 11
display_name: '&bDoppelte Drops'
lore:
priority: 1
update: false
click_commands: []

'mobs_ignorieren':
material: zombie_spawn_egg
slot: 12
display_name: '&bMobs ignorieren dich'
lore:
priority: 1
update: false
click_commands: []

'godmode':
material: ENCHANTED_GOLDEN_APPLE
slot: 13
display_name: '&bGodmode'
lore:
priority: 1
update: false
click_commands: []

'back':
material: itemsadder-icon_back_white
slot: 47
display_name: '&eZurück'
lore:
priority: 0
update: false
hide_attributes: true
click_commands:
- '[player] perks'

worthy flower
#

Search on wiki

reef flume
#

If i would have found anything i wouldnt ask here

jaunty elk
# reef flume How can i make a Toggle-Button for the Perks to activate/deactivate? This is a P...

I'll give you one example.

  'noperm1':
    material: BARRIER
    slot: 19
    display_name: '&4Nicht Freigeschaltet'
    lore: []
    priority: 0
    update: false
    click_commands: []
    view_requirement:
      requirements:
        perm:
          type: '!has permission'
          permission: 'your.permission'
  'inactive':
    material: red_wool
    slot: 19
    display_name: '&4Click to activate!'
    lore: []
    priority: 1
    update: false
    click_commands:
      - '[console] SET ACTIVE STATUS HERE'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'your.permission'
        is_inactive:
          type: 'string equals ignorecase'
          input: '%your_placeholder%'
          output: 'no'
  'active':
    material: green_wool
    slot: 19
    display_name: '&aClick to deactivate!'
    lore: []
    priority: 1
    update: false
    click_commands:
      - '[console] SET INACTIVE STATUS HERE'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'your.permission'
        is_inactive:
          type: 'string equals ignorecase'
          input: '%your_placeholder%'
          output: 'yes'
#

You will have to replace %your_placeholder% with a proper status placeholder, your.permission with whatever permission you want and SET ACTIVE/INACTIVE STATUS HERE with a proper status changing command.

reef flume
#

thank you very much

#

can i use it without placeholders?

#

would this work right here? "https://mclo.gs/8lI5DAp" because when i try do deactivate, it says "You already deactivated this Perk"

#

and i cant deactivate it per button, only per command

#

i use fancyperks

jaunty elk
#

The menu needs to know if a perk is activated or not.

reef flume
#

how else can i do it? i believe the plugin has no placeholders

#

is there any other way to do it with some values or do you know if fancyperks has some sort of placeholders?

jaunty elk
#

This would not be great if you allow players to use commands as well

#
  'noperm1':
    material: BARRIER
    slot: 19
    display_name: '&4Nicht Freigeschaltet'
    lore: []
    priority: 0
    update: false
    click_commands: []
    view_requirement:
      requirements:
        perm:
          type: '!has permission'
          permission: 'your.permission'
  'inactive':
    material: red_wool
    slot: 19
    display_name: '&4Click to activate!'
    lore: []
    priority: 1
    update: false
    click_commands:
      - '[console] lp user %player_name% permission set other.permission'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'your.permission'
        is_inactive:
          type: '!has permission'
          permission: 'other.permission'
  'active':
    material: green_wool
    slot: 19
    display_name: '&aClick to deactivate!'
    lore: []
    priority: 1
    update: false
    click_commands:
      - '[console] lp user %player_name% permission unset other.permission'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'your.permission'
        is_inactive:
          type: 'has permission'
          permission: 'other.permission'

It would look something like this

#

your.permission is the permission players need to be able to use the option and
other.permission is simply used to detect if the option is enabled or not

reef flume
#

Can i create my own permissions with deluxemenus? So i can set permissions like perks.enable.1 or something

jaunty elk
reef flume
#

Okey i will try it and then Text if it worked!

reef flume
#

i dont exactly unterstand how to set it up. can you give me the example with following permissions: mainperm is "fancyperks.perk.telekinesis" for this one. then the command is perks activate telekinesis but i dont understand the one with "other.permission"

jaunty elk
#

it will only be used by DeluxeMenus

#

to know if the perk is active or not

reef flume
#

so i have to replace EVERY "other.permission" with for example "perks.1"?

#
  'noperm1':
    material: BARRIER
    slot: 19
    display_name: '&4Nicht Freigeschaltet'
    lore: []
    priority: 0
    update: false
    click_commands: []
    view_requirement:
      requirements:
        perm:
          type: '!has permission'
          permission: 'fancyperks.perk.telekinesis'
  'inactive':
    material: red_wool
    slot: 19
    display_name: '&4Click to activate!'
    lore: []
    priority: 1
    update: false
    click_commands:
      - '[console] lp user %player_name% permission set perks.1'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'fancyperks.perk.telekinesis'
        is_inactive:
          type: '!has permission'
          permission: 'perks.1'
  'active':
    material: green_wool
    slot: 19
    display_name: '&aClick to deactivate!'
    lore: []
    priority: 1
    update: false
    click_commands:
      - '[console] lp user %player_name% permission unset perks.1'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'fancyperks.perk.telekinesis'
        is_inactive:
          type: 'has permission'
          permission: 'perks.1'```
#

i made this but the slot is empty, if the player has "fancyperks.perk.telekinesis"

reef flume
#

no i unset all permissions

#

its really weird

#

if i give myself the permission, the item disapears

#

do you maybe know whats wrong?

jaunty elk
#

oh. I see the problem

#
  # TELEKINESIS
  'noperm1':
    material: BARRIER
    slot: 19
    display_name: '&4Nicht Freigeschaltet'
    lore: []
    priority: 0
    update: false
    click_commands: []
    view_requirement:
      requirements:
        perm:
          type: '!has permission'
          permission: 'fancyperks.perk.telekinesis'
  'inactive':
    material: red_wool
    slot: 19
    display_name: '&4Click to activate!'
    lore: []
    priority: 1
    update: false
    click_commands:
      - '[console] lp user %player_name% permission set perks.1'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'fancyperks.perk.telekinesis'
        is_inactive:
          type: '!has permission'
          permission: 'perks.1'
  'active':
    material: green_wool
    slot: 19
    display_name: '&aClick to deactivate!'
    lore: []
    priority: 2
    update: false
    click_commands:
      - '[console] lp user %player_name% permission unset perks.1'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'fancyperks.perk.telekinesis'
        is_inactive:
          type: 'has permission'
          permission: 'perks.1'

Try this @reef flume

reef flume
#
[15:16:19 INFO]: [LuckPerms] [Messaging] Sending log with id: f945ae7d-d3fa-45fe-86d1-81dd90e5e78d
[15:16:19 INFO]: [LuckPerms] [Messaging] Sending user ping for 'slxstiifxlix' with id: 52f45ca1-01d9-4ff0-bdaa-076063cd3959
[15:16:19 INFO]: [LP] slxstiifxlix already has perks.1 set in context global.
[15:16:19 INFO]: [LP] slxstiifxlix already has perks.1 set in context global.
[15:16:19 INFO]: [LP] slxstiifxlix already has perks.1 set in context global.
[15:16:19 INFO]: [LP] slxstiifxlix already has perks.1 set in context global.``` but nothing changes ingame
#

do you want all the logs or only from deluxemenu

#

oohhh

#

it works but just doenst update

#

how can i make, that it updates the gui and instantly shows up?

jaunty elk
#
  # TELEKINESIS
  'noperm1':
    material: BARRIER
    slot: 19
    display_name: '&4Nicht Freigeschaltet'
    lore: []
    priority: 0
    update: false
    click_commands: []
    view_requirement:
      requirements:
        perm:
          type: '!has permission'
          permission: 'fancyperks.perk.telekinesis'
  'inactive':
    material: red_wool
    slot: 19
    display_name: '&4Click to activate!'
    lore: []
    priority: 1
    update: false
    click_commands:
      - '[console] lp user %player_name% permission set perks.1'
      - '[refresh]'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'fancyperks.perk.telekinesis'
        is_inactive:
          type: '!has permission'
          permission: 'perks.1'
  'active':
    material: green_wool
    slot: 19
    display_name: '&aClick to deactivate!'
    lore: []
    priority: 2
    update: false
    click_commands:
      - '[console] lp user %player_name% permission unset perks.1'
      - '[refresh]'
    view_requirement:
      requirements:
        perm:
          type: 'has permission'
          permission: 'fancyperks.perk.telekinesis'
        is_inactive:
          type: 'has permission'
          permission: 'perks.1'

Like this @reef flume