#(DoTheFlopBoy) What is the best way to create a AdminShop (GUI based)?

27 messages · Page 1 of 1 (latest)

wide inlet
#

Hi, i want to create a Server/Admin Shop where the players can buy and sell items in. It should has a main GUI where you can select a shop section. I have started to create it by create for all shop items a own item script, but is it a good solutuon or are there better ways to do it? I was thinking about using yaml or maybe flags.

Paste: https://paste.denizenscript.com/View/103813

Any recommendations?

golden estuaryBOT
#

(DoTheFlopBoy) What is the best way to create a AdminShop (GUI based)?

#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

wintry girder
#

define "best". the way that works and doesn't impact your server too heavily, the one that makes the most sense to you, and makes the most sense for your server, is the "best".

flags is a totally legitimate way to go about this. yaml, not so much; it's really more for plugin interop and the like.

#

if you're currently creating an itemscript for every item in the game, you might want to consider just making a proc that returns an item, but with some lore attached to it.

wide inlet
#

How to get the top inventory which the player views for player clicks item in inventory event?

toxic ibex
#

!e event clicks inventory

vague cometBOT
#
Possible Confusion

Did you mean to search for player click_type clicks item in inventory?

vague cometBOT
# toxic ibex !e event clicks inventory
Group

Player

Event Lines

player (<click_type>) clicks (<item>) in <inventory>

Switches

with:<item> to only process the event if a specified cursor item was used.
in_area:<area> replaces the default 'in:<area>' for this event.
action:<action> to only process the event if a specified action occurred.
slot:<slot> to only process the event if a specified slot or slot_type was clicked. For slot input options, see !language Slot Inputs.

Triggers

when a player clicks in an inventory. Note that you likely will also want to listen to !event player drags in inventory.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.item> returns the ItemTag the player has clicked on.
<context.inventory> returns the InventoryTag (the 'top' inventory, regardless of which slot was clicked).
<context.clicked_inventory> returns the InventoryTag that was clicked in.
<context.cursor_item> returns the item the Player is clicking with.
<context.click> returns an ElementTag with the name of the click type. Click type list: <@link url...
<context.slot_type> returns an ElementTag with the name of the slot type that was clicked. Slot ty...
<context.slot> returns an ElementTag with the number of the slot that was clicked.
<context.raw_slot> returns an ElementTag with the raw number of the slot that was clicked.
<context.is_shift_click> returns true if 'shift' was used while clicking.
<context.action> returns the inventory_action. See <@link language Inventory Actions>.
... and 1 more.

Determine

ItemTag to set the current item for the event.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

wide inlet
#

but how to check if the player clicks in the opend inventory and not in his own inventory?

toxic ibex
#

you have context tags available, that return the clicked inventory and also always return the top inventory

wide inlet
#

i tried:

- if <context.clicked_inventory> == <inventory[inventoryScriptName]>:

but it gives false

toxic ibex
#

<inventory[]> creates another instance of that inventory

echo mulch
#

with correct click type ofc

toxic frigateBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please type </resolved:1028673926114594866> to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@wide inlet