Need help with my script.

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

Danielh90

Member
Jan 8, 2018
10
0
0
24
Hello, I am trying to make so when a player clicks a item on the gui he will receive a custom item. Here is my code. Can anyone tell me want I'm doing wrong?
code_language.skript:
command /14101:
  permission: script.shop
  permission message: &cYou do not have have access to this command.
  description: Player Shop
  trigger:
    open chest with 3 rows named "&c&lPlayer Shop" to player
    format slot 1 of player with diamond hoe:1 named "&cPlains" to close then run [make console execute "/give %player% diamond_hoe 1 0 {display:{Name:"Hat 1"},HideFlags:4,Unbreakable:1}"]
 
Hello, I am trying to make so when a player clicks a item on the gui he will receive a custom item. Here is my code. Can anyone tell me want I'm doing wrong?
code_language.skript:
command /14101:
  permission: script.shop
  permission message: &cYou do not have have access to this command.
  description: Player Shop
  trigger:
    open chest with 3 rows named "&c&lPlayer Shop" to player
    format slot 1 of player with diamond hoe:1 named "&cPlains" to close then run [make console execute "/give %player% diamond_hoe 1 0 {display:{Name:"Hat 1"},HideFlags:4,Unbreakable:1}"]
Format slot is very unreliable. It'd be best to use Tuske for GUI's. So something like this
code_language.skript:
create gui with virtual chest with size 3 named "&c&lPlayer Shop":
    make gui slot 1 with diamond hoe:1 named "&cPlains":
        execute console command "/give %player% diamond_hoe 1 0 {display:{Name:"Hat 1"},HideFlags:4,Unbreakable:1}"
open last gui to player
 
Or you can use the script you used, and add 'command' after the 'execute console' part: :emoji_blush:
code_language.skript:
format slot 1 of player with diamond hoe:1 named "&cPlains" to close then run [make console execute command "/give %player% diamond_hoe 1 0 {display:{Name:"Hat 1"},HideFlags:4,Unbreakable:1}"]
You can also use TuSKe for GUI's as @Wynnevir said or something else.
 
Last edited:
  • Like
Reactions: martinpeeters34
Format slot is very unreliable. It'd be best to use Tuske for GUI's. So something like this
code_language.skript:
create gui with virtual chest with size 3 named "&c&lPlayer Shop":
    make gui slot 1 with diamond hoe:1 named "&cPlains":
        execute console command "/give %player% diamond_hoe 1 0 {display:{Name:"Hat 1"},HideFlags:4,Unbreakable:1}"
open last gui to player
Thank you. I got my gui working I just need to figure out how to d more commands to them.
 
No, the opening of the gui is the last step. you would put it under the slot formatting that you wanted to trigger the close.
Ok thanks. Also two more things I want a lore on the block when they hover it I tried. But did not work. Also I'm trying to make it so if they player has $100 in his bank account he or she can buy but if not wont' take the money out how would I go on about doing that?
code_language.skript:
 make gui slot 2 with white wool named "&bWhite Wool" with lore "Something Here":
 
For new questions, solve this one out and make a new post.
But for lore you have it right, it's your item that I believe is wrong. needs to be "white wool block".
if you don't want it to take the money, then include a stop after the check.
 
For new questions, solve this one out and make a new post.
But for lore you have it right, it's your item that I believe is wrong. needs to be "white wool block".
if you don't want it to take the money, then include a stop after the check.
Ok Thanks :emoji_slight_smile: for your help
 
Status
Not open for further replies.