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...
#Help with Perks-GUI
1 messages · Page 1 of 1 (latest)
Use view_quirements and priority
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'
Search on wiki
If i would have found anything i wouldnt ask here
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.
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
No. You need either a placeholder or some sort of value to check
The menu needs to know if a perk is activated or not.
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?
I am not familiar with fancyperks. You could use permissions for enabling/disabling
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
Can i create my own permissions with deluxemenus? So i can set permissions like perks.enable.1 or something
You can set whatever permissions you want, yes
Okey i will try it and then Text if it worked!
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"
You can put any permission you want there
it will only be used by DeluxeMenus
to know if the perk is active or not
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"
Are you OP when testing?
no i unset all permissions
its really weird
if i give myself the permission, the item disapears
do you maybe know whats wrong?
Can you go to plugins/DeluxeMenus/config.yml and set debug: LOWEST, restart the server and send startup logs here?
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
[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
here is only the one from deluxemenus
oohhh
it works but just doenst update
how can i make, that it updates the gui and instantly shows up?
add a [refresh] action
# 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