Solved Armor stand-gui

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

mike

Member
Jun 28, 2017
23
0
0
28
Hey there i wondered ig anyone could give me a hand. im currently using dice furniture and i want to make it so when a player right click a certain armour stand it will open a gui. Ideally the gui would change depending on stand they right click. I only know the very basic elements of skript atm. any help would be great though.
 
Options:
1. You can compare the coordinates of the armorstand with a specific one, if their both the same, execute the gui.
2. You could give the armor stand a metadata, and once a player right click it, check if the click entity has that metadata.
3.If a player right clicks an armorstand in a certain region, execute the gui.

These are the options that you can do to open a gui from a specific armor stand.
 
Well, after doing a bit of research, Dice Furniture uses the invisible armour stand entities similar to holograms, so using basic right-clicking functions probably won't have any affect on them.

I've been trying a few things that might work, and I came up with this solution of sorts:

code_language.skript:
# in order to delete the holograms
command /holodel:
    trigger:
        delete holo object "%uuid of player%.trashCan"
        delete holo object "%uuid of player%.mailBox"

# right click with DiceFurniture's spawning egg
on rightclick with 383:0:
    set {_loc} to target block
    # will need to do with for all custom actions
    name of player's tool is "&cTrashCan":
        # will need to specify location of hologram with each thing
        add 1 to y-coord of {_loc}
        create interactive holo object "" with id "%uuid of player%.trashCan" at {_loc}
    name of player's tool is "&cMailBox":
        add 2 to y-coord of {_loc}
        if "%player's horizontal facing%" is "north":
            subtract 0.5 from z-coord of {_loc}
        if "%player's horizontal facing%" is "south":
            add 0.5 to z-coord of {_loc}
        if "%player's horizontal facing%" is "east":
            subtract 0.5 from x-coord of {_loc}
        if "%player's horizontal facing%" is "west":
            add 0.5 to x-coord of {_loc}
        create interactive holo object "" with id "%uuid of player%.mailBox" at {_loc}

on hologram click:
    if event-string contains "trashCan":
        open chest with 3 row named "&cTrash" to player
    if event-string contains "mailBox":
        open chest with 3 row named "&bMail" to player
        # would need some inventory saving thing going on here

It uses skRayFall's interactive holograms, since I was unable to find a way to just right-click the block itself. The clicking actions themselves are done via the holograms. The only problem I faced was finding a way to delete the holograms along side the destruction of the furniture, which I was unsuccessful with.
 
Thank you but for it done :emoji_grinning:
[doublepost=1498781717,1498781655][/doublepost]Has anyone got a gui skript? like double chest full of stained glass?
 
I tried to use metadata, never used them before, but it worked on my server. I guess it was the hologram clicking, not rightclicking on armor stand.

iirc, metadata gets reset upon server restart, so it may not have been the best solution in the long run. I was considering using NBT data, but ultimately reconsidered when I found neither on armour stand interact (MundoSK) nor on right click on entity (Skript) yielded any results
 
iv got it working :emoji_grinning:
The next issue is

on right click with written book named "&6Ftv Book":
cancel event
execute player command "/Booking"

but it cant notice the book naame
 
iv got it working :emoji_grinning:
The next issue is

on right click with written book named "&6Ftv Book":
cancel event
execute player command "/Booking"

but it cant notice the book naame
Don't believe you use names in the event. So, to get the name, you do this.
code_language.skript:
on right click of written book:
    if name of player's event-item is "&6Ftv Book":
        cancel event
        execute player command "/Booking"
 
What im trying to do is. when they "purchase" the item with 10 exp to change the barrier in slot 0 to a furnace in slot 0. Any advice?



code_language.skript:
command /booking:
    trigger:
        create a gui with virtual chest with 4 rows named "Mikeanism Guide":
            if {furnace.%uuid of player%} is set:
                make gui slot 0 with burning_furnace
            else:
                make gui slot 0 with barrier:
                    if gui-click-type is right mouse button:
                        if player's level is greater than or equal to 10:
                            subtract 10 from player's level
                        else:
                            message "not enough exp"
                    else if gui-click-type is left mouse button:
                        if player has permission "permission":
                            broadcast "it worked"
                        else:
                            message "no perm"
        open last created gui to player
 
Status
Not open for further replies.