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 out 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.

Help with Skript open Gui clicking a entity

Discussion in 'Skript' started by Tonipop, Jan 3, 2022.

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

    Tonipop Member

    Joined:
    Aug 15, 2021
    Messages:
    12
    Likes Received:
    0
    hello, i need a help making a GUI .
    version is 1.16.5
    Skript 2.6 , SkQuery v4.1.4, MorkazSk v1.2, skRayFall v1.9.25, skript-gui v1.3-beta1 ,Skellett v1.9.11
    i CAN'T use Tuske Because of error, so i installed Skript-gui (but idk how it works)

    the Gui and click worked
    Code (Text):
    1. on click on armor stand:
    2.     if name of clicked entity is "gunshop":
    3.         open chest with 3 rows named "&cGUN SHOP" to player
    4.         if player's money is less than 270:
    5.             format slot 0 of player with wooden shovel named "&7MP5" with lore "&fType: &bSMG" and "&fAmmo: &cRed Hawk" and "&fPrice: &c$270 You can not afford" to be unstealable
    6.         if player's money is more than or equal to 270:
    7.             format slot 0 of player with wooden shovel named "&7MP5" with lore "&fType: &bSMG" and "&fAmmo: &cRed Hawk" and "&fPrice: &a$270" to close then run [console command "shot give %player% mp5"]->[subtract 270 from player's money]->[send "&aYou bought a &7MP5"]

    BUT , when I open the Gui it no works i can take ( it shouldn't to be stealable) the item but can't make execute the command
    using on command works but i don't want to use because they might use in anywhere ...

    so for that reason i wanted to put in a entity and only can access the GUI clicking the entity.
     
  2. IlanBirn

    IlanBirn Member

    Joined:
    Jan 4, 2022
    Messages:
    4
    Likes Received:
    0
    I see many problems here, Let me try fixing it, and explaining how it works...
    I suggest you not use the Skript-GUI addon or tuske, but use the good ol' vannila one.
    here's my skript:
    Code (Text):
    1. on right click on armor stand:
    2.     if entity's name is "gunshop":
    3.         set metadata "gunshop" of player to chest inventory with 3 rows named "&cGUN SHOP"
    4.         set slot 3 of metadata tag "gunshop" of player to wooden shovel named "&7MP5" with lore "&fType: &bSMG%nl%&fAmmo: &cRed Hawk%nl%&fPrice: &c$270"
    5. #the %nl% means next line, this is the vanilla way
    6. #now we need to make it so it subtracts the money from the player
    7.  
    8.  
    9. on inventory click:
    10.     if event-inventory = (metadata tag "gunshop" of player):
    11.         cancel event
    12.         if index of event-slot is 3:
    13.             subtract 270 from player's money
    14.             give to player 1 wooden shovel named "&7MP5" with lore "&fType: &bSMG%nl%&fAmmo: &cRed Hawk%nl%&fPrice: &c$270"
    15.  
     
  3. Tonipop

    Tonipop Member

    Joined:
    Aug 15, 2021
    Messages:
    12
    Likes Received:
    0

    I see, then i gotta use vanilla with this code, thanks .
     
  4. IlanBirn

    IlanBirn Member

    Joined:
    Jan 4, 2022
    Messages:
    4
    Likes Received:
    0
    glad i could help!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...