Hello everybody, I am making my own skript for voting points | shop but I have a few problem with the GUI of Tuskie or even dont know how to do it.
So this is my code for buy an item from the Shop
This is how its look http://prntscr.com/lvw2q5 but the problem become when I try to buy something I have enough points but it show me this http://prntscr.com/lvw32a even it does not show the item as should.
But when I am doing it this way below its working great... But I want to made it streat from the GUI above not with two commands.. Can somebody help me.
Note! I am not from UK or any other country where the 1st language is English ! I am sorry for my english know its not well, hope somebody can help me.
So this is my code for buy an item from the Shop
code_language.skript:
trigger:
if arg 1 is "shop":
if arg 2 is not set:
if arg 3 is not set:
open virtual chest inventory with size 3 named "{@mshop}" to player
wait 1 ticks
loop {VotePointShop::*}:
add 1 to {_gui.shop.slots}
loop {VotePointShopItem::%loop-value-1%::*}:
format gui slot {_gui.shop.slots} -1 of player with loop-value-2 with lore "" and "{@itembuying}" and "&7&l{@itemprice}&f&l: &b%{VotePointShopPrice::%loop-value-1%::*}% {@prefix}" to run:
if {votepoints.%player's uuid%} >= {VotePointShopPrice::%loop-value-1%::*}:
give {VotePointShopItem::%{loop-value-1}%::*} to player
remove {VotePointShopPrice::%{loop-value-1}%::*} from {votepoints.%player's uuid%}
close inventory of player
send "{@doneline}"
send ""
message centered "{@dcolor}Congratulations you have bought &c%{VotePointShopItem::%loop-value-1%::*}% {@dcolor}for &9%{VotePointShopPrice::%loop-value-1%::*}%" to player
message centered "{@icolor}Now you have&f&l: &9%{votepoints.%player's uuid%}% VotePoints" to player
send ""
send "{@doneline}"
else:
close inventory of player
send "{@infoline}"
send ""
message centered "{@icolor}You don't have enough {@prefix} {@icolor}to purchase &b%{VotePointShopItem::%loop-value-1%::*}%" to player
message centered "&7The item price is&f&l: &9%{VotePointShopPrice::%loop-value-1%::*}% {@prefix} &8&l❙ {@YouHave}" to player
send ""
send "{@infoline}"
This is how its look http://prntscr.com/lvw2q5 but the problem become when I try to buy something I have enough points but it show me this http://prntscr.com/lvw32a even it does not show the item as should.
But when I am doing it this way below its working great... But I want to made it streat from the GUI above not with two commands.. Can somebody help me.
Note! I am not from UK or any other country where the 1st language is English ! I am sorry for my english know its not well, hope somebody can help me.
code_language.skript:
command /testbuy [<text>]:
trigger:
if arg is not set:
loop {VotePointShop::*}:
json("%player%", "&c&l&%loop-value%||ttp: &aClick Me &c;) ||cmd:/testbuy %loop-value%")
else:
if {votepoints.%player's uuid%} >= {VotePointShopPrice::%arg%::*}:
give {VotePointShopItem::%arg%::*} to player
remove {VotePointShopPrice::%arg%::*} from {votepoints.%player's uuid%}
send "Yes you buy that item!"
else:
send "nope point !"
send "You need: &7%{VotePointShopPrice::%arg%::*}%"
command /testmainmenu [<text>]:
trigger:
if arg is not set:
open virtual chest inventory with size 1 named "test" to player
wait 1 ticks
loop {VotePointShop::*}:
add 1 to {_gui.shop.slots}
loop {VotePointShopItem::%loop-value-1%::*}:
format gui slot {_gui.shop.slots} -1 of player with loop-value-2 to run player command "/testbuy %loop-value-1%"