#Need help with a kit menu

1 messages · Page 1 of 1 (latest)

floral oar
#

I made a simply UI for the Iron Kit preview, the rank is not yet made so i am using the Admin Rank as a permission, for now. The thing is i made 2 simple items with Available for claim or unavailable. It always shows the unavailable item, even if i have the admin group. Any ideeas or fix? I will have the code bellow.

#
menu_title: "IRONKIT"
size: 36
register_command: true
items:

  'Item-1':
    material: IRON_HELMET
    slot: 0
  'Item-2':
    material: IRON_CHESTPLATE
    slot: 1
  'Item-3':
    material: IRON_LEGGINGS
    slot: 2
  'Item-4':
    material: IRON_BOOTS
    slot: 3
  'Item-5':
    material: IRON_SWORD
    slot: 4
  'Item-6':
    material: IRON_AXE
    slot: 5
  'Item-7':
    material: IRON_PICKAXE
    slot: 6
  'Item-8':
    material: crossbow
    slot: 7
  'Item-9':
    material: arrow
    amount: 32
    slot: 8
  'Item-10':
    material: splash_potion
    display_name: '&fSplash Potion of Healing'
    slot: 9
    potion_effects:
    - INSTANT_HEALTH;0;0
  'Item-11':
    material: splash_potion
    display_name: '&fSplash Potion of Healing'
    slot: 10
    potion_effects:
    - SPEED;1800;1
  'Item-12':
    material: LIGHT_BLUE_BED
    slot: 11
  'Item-13':
    material: ender_pearl
    amount: 2
    slot: 12
  'Item-14':
    material: GOLDEN_APPLE
    amount: 3
    slot: 13
  'Item-15':
    material: cooked_porkchop
    amount: 16
    slot: 14
  #INCEPUTUL DE SYNTAXA
  'kit-claim-available':
    material: GREEN_STAINED_GLASS_PANE
    slots:
    - 32-35
    display_name: '&a&lClaim ADMIN kit'
    lore:
    - '&7Primește kitul pentru rangul &fADMIN&7.'
    click_commands:
    - '[close]'
    - '[player] playerkits claim ADMIN'
  condition: 'has_admin'

  'kit-claim-unavailable':
    material: RED_STAINED_GLASS_PANE
    slots:
    - 32-35
    display_name: '&c&lNu ai acces la kit'
    lore:
    - '&7Acest kit este disponibil doar pentru rangul &fADMIN&7.'
    click_commands:
    - '[message] &8&l[&c&l!&8&l] &fAcest kit este disponibil doar pentru &cADMIN&f!'
    - '[close]'
    condition: 'not_admin'

  conditions:
    has_admin:
      type: 'has permission'
      condition: 'group.admin'

    not_admin:
      type: '!has permission'
    condition: 'group.admin'



wide haven
floral oar
#

i modified the code a bit

#
'kit-available':
    material: GREEN_STAINED_GLASS_PANE
    slots:
    - 32-35
    display_name: '&a&lClaim ADMIN kit'
    lore:
    - '&7Primește kitul pentru rangul &fADMIN&7.'
    click_commands:
    - '[close]'
    - '[player] playerkits claim IRON'
    view_requirement:
      requirements:
        has_perm:
          type: 'has permission'
          permission: 'group.admin'
          output: "yes"
    priority: 0

  'kit-unavailable':
    material: RED_STAINED_GLASS_PANE
    slots:
    - 32-35
    display_name: '&c&lNu ai acces la kit'
    lore:
    - '&7Acest kit este disponibil doar pentru rangul &fADMIN&7.'
    click_commands:
    - '[message] &8&l[&c&l!&8&l] &fAcest kit este disponibil doar pentru &cADMIN&f!'
    - '[close]'
    priority: 1
#

not it works

#

it sems like so

floral oar
#
'kit-available':
    material: GREEN_STAINED_GLASS_PANE
    slots:
    - 27-35
    display_name: '&a&lClaim ADMIN kit'
    lore:
    - '&7Primește kitul pentru rangul &fADMIN&7.'
    click_commands:
    - '[close]'
    - '[player] playerkits claim IRON'
    view_requirement:
      requirements:
        has_perm:
          type: 'has permission'
          permission: 'group.admin'
          output: "yes"
    priority: 1

  'kit-unavailable':
    material: RED_STAINED_GLASS_PANE
    slots:
    - 27-35
    display_name: '&c&lNu ai acces la kit'
    lore:
    - '&7Acest kit este disponibil doar pentru rangul &fADMIN&7.'
    click_commands:
    - '[message] &8&l[&c&l!&8&l] &fAcest kit este disponibil doar pentru &cADMIN&f!'
    - '[close]'
    priority: 2

Now how do i make a new item to show when the kit is on cooldown with this placeholder "%playerkits_cooldown_IRON%"?

cunning flame
#

Also, the "has permission" requirement does not need output. You can use it like this:

    view_requirement:
      requirements:
        has_perm:
          type: 'has permission'
          permission: 'group.admin'```
floral oar
#

so i can use this %playerkits_cooldown_IRON%?

#

as a placeholder?

cunning flame
#

Yes. You can use any placeholder as requirement.

#

There are requirement types such as string equals for string comparison and then also math comparators such as == >= > <= and <

#

those work with numbers

#

In the example I sent you can look at item kit_tools_cooldown to see how the placeholder is used as a requirement

floral oar
#
kit_not_ready:
        type: 'placeholder'
        placeholder: '%playerkits_cooldown_IRON%?
        equals: 'NO'
        output: 'yes'

This is something i tried a few hours ago but didn't work ill take a look in the example guis

#

is this compatible with playerkits plugin?

#
kit_tools_cooldown':
    material: ORANGE_CONCRETE
    slot: 13
    priority: 2
    update: true
    view_requirement:
      requirements:
        permission:
          type: has permission
          permission: essentials.kits.tools
        available:
          type: string equals ignorecase
          input: '%essentials_kit_is_available_tools%'
          output: 'no'
    display_name: ' &c&lTools '
    lore:
    - ''
    - '&8• &7Kit: &cTools'
    - '&8• &7Status: &cOn Cooldown'
    - '&8• &7Available In: &c%essentials_kit_time_until_available_tools%'
    - ''
    click_commands:
    - '[refresh]'

Bc i see a placeholder input '%essentials_kit_is_available_tools%' but playerkits only has 2 placeholders

#

so the easier thing will be to use essentials kit

cunning flame
#

What are the possible values?

floral oar
#

Returns the current player cooldown for the specified kit. When the cooldown is ready, it will return this message from the messages.yml file: cooldownPlaceholderReady

#

cooldownPlaceholderReady i think

cunning flame
#

Can you try /papi parse me %playerkits_cooldown_IRON% with a kit that you have no cooldown for?

#

Just to be sure.

floral oar
cunning flame
#

This is going to suck. Can you change the output to something else?

#

Or do you use this output in other places as well?

floral oar
#

nope

#

i dont

cunning flame
#

It would be a lot more easier if it returned a simple Ready with no color codes

#

or anything like that

floral oar
#

i mean if im going to make a kit menu, do i really need Playerkits?

#

i think it would be much more reliable with essentials

#

right?

cunning flame
#

I am not sure how PlayerKits works. So I can't tell you for sure.

floral oar
#

or will that get to complicated

#

playerkits makes kits with what you have in your inventory

#

and then has it's own UI

cunning flame
#

Oh. Well if you're going to make your own UI, I don't see a problem with using Essentials Kits instead

floral oar
#

and you can edit the kits with their own UI, but a lot of server don't use it because they make their own UIs

#

yeah. So if im going to use Essentials everything i need to know is there from what i saw

cunning flame
#

Yeah it should be

floral oar
#

thanks Blitz, if i have anymore problems do i make a new thread, or keep this one instead?