#Admin database

1 messages · Page 1 of 1 (latest)

rapid hare
#

GUI doesnt Show up:
command /admin-db-search <text>:
permission: admin.db.search
trigger:
loop {admin.items::*}:
if loop-value's lore contains arg-1:
send "&aFound: %loop-value%"
stop

Datenbank hinzufügen Befehl

command /admin-db-add:
permission: admin.db.add
trigger:
if player's tool is not air:
add player's tool to {admin.items::*}
send "&aItem added."
else:
send "&cYou need to hold a valid item."
stop

Admin-Datenbank GUI öffnen Befehl

command /admin-database:
permission: admin.db.open
trigger:
openAdminDatabase(player)

Funktion zum Öffnen des Admin-Datenbank GUIs

function openAdminDatabase(p: player):
open virtual chest inventory with size 6 named "&aAdmin-Database" to {_p}
set {_i} to 0
loop {admin.items::*}:
set slot {_i} of {_p}'s current inventory to loop-value
add 1 to {_i}
set slot 53 of {_p}'s current inventory to anvil named "&cEntfernen-Modus" with lore "&7Klicke hier, um in den Entfernen-Modus zu wechseln"

Klick im GUI

on inventory click:
if inventory name of player's current inventory is "&aAdmin-Database":
cancel event
set {_item} to clicked item
if {_item} is an anvil named "&cEntfernen-Modus":
set metadata value "removal_mode" of player to true
send "&aEntfernen-Modus aktiviert. Klicke auf ein Item, um es zu entfernen."
set slot 53 of {_p}'s current inventory to anvil named "&cRemove-off!"
else if {_item} is not air:
if metadata value "removal_mode" of player is true:
remove {admin.items::%clicked slot%}
send "&a."
close player's inventory
wait 0.5 seconds
openAdminDatabase(player)
else:
give {_item} to player
clear lore of player's tool
stop

#

Anyone knows Why?

nimble granite
#

I do indeed know why

#

When you add the tool it doesn’t have a * at the end of the array

#

😁

trail totem