1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Armor stand-gui

Discussion in 'Skript' started by mike, Jun 28, 2017.

Thread Status:
Not open for further replies.
  1. mike

    mike Member

    Joined:
    Jun 28, 2017
    Messages:
    23
    Likes Received:
    0
    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.
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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.
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    anyone? so far knowone knows how to
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    You're just going to ignore Farid's post and hope someone spoonfeeds you?
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    no me and farid worked on it in pms
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Ah, nothing he suggested in his post worked?
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    But he couldnt figure it out
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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 (Skript):
    1. # in order to delete the holograms
    2. command /holodel:
    3.     trigger:
    4.         delete holo object "%uuid of player%.trashCan"
    5.         delete holo object "%uuid of player%.mailBox"
    6.  
    7. # right click with DiceFurniture's spawning egg
    8. on rightclick with 383:0:
    9.     set {_loc} to target block
    10.     # will need to do with for all custom actions
    11.     name of player's tool is "&cTrashCan":
    12.         # will need to specify location of hologram with each thing
    13.         add 1 to y-coord of {_loc}
    14.         create interactive holo object "" with id "%uuid of player%.trashCan" at {_loc}
    15.     name of player's tool is "&cMailBox":
    16.         add 2 to y-coord of {_loc}
    17.         if "%player's horizontal facing%" is "north":
    18.             subtract 0.5 from z-coord of {_loc}
    19.         if "%player's horizontal facing%" is "south":
    20.             add 0.5 to z-coord of {_loc}
    21.         if "%player's horizontal facing%" is "east":
    22.             subtract 0.5 from x-coord of {_loc}
    23.         if "%player's horizontal facing%" is "west":
    24.             add 0.5 to x-coord of {_loc}
    25.         create interactive holo object "" with id "%uuid of player%.mailBox" at {_loc}
    26.  
    27. on hologram click:
    28.     if event-string contains "trashCan":
    29.         open chest with 3 row named "&cTrash" to player
    30.     if event-string contains "mailBox":
    31.         open chest with 3 row named "&bMail" to player
    32.         # 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.
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Thank you but for it done :emoji_grinning:
    --- Double Post Merged, Jun 30, 2017, Original Post Date: Jun 30, 2017 ---
    Has anyone got a gui skript? like double chest full of stained glass?
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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.
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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
     
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Don't believe you use names in the event. So, to get the name, you do this.
    Code (Skript):
    1. on right click of written book:
    2.     if name of player's event-item is "&6Ftv Book":
    3.         cancel event
    4.         execute player command "/Booking"
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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 (Skript):
    1. command /booking:
    2.     trigger:
    3.         create a gui with virtual chest with 4 rows named "Mikeanism Guide":
    4.             if {furnace.%uuid of player%} is set:
    5.                 make gui slot 0 with burning_furnace
    6.             else:
    7.                 make gui slot 0 with barrier:
    8.                     if gui-click-type is right mouse button:
    9.                         if player's level is greater than or equal to 10:
    10.                             subtract 10 from player's level
    11.                         else:
    12.                             message "not enough exp"
    13.                     else if gui-click-type is left mouse button:
    14.                         if player has permission "permission":
    15.                             broadcast "it worked"
    16.                         else:
    17.                             message "no perm"
    18.         open last created gui to player
    19.        
     
Thread Status:
Not open for further replies.
Loading...