Skript Version: 2.2-dev31c
Skript Author: Bensku
Minecraft Version: 1.10.2
---
Full Code:
Errors on Reload: None
Console Errors: None
Addons using (including versions): Tuske, MundoSK
Troubleshooting: I tryed to make another solid variable,changing its lores for the info, and nothings happends.
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
Another info:
Hi! I have a trouble making a trade sistem. It works on this way.
Players can sell the item to other players in a type of "bazar", a villager that just stands there and receives items from players, and sells them to other players, something like RuneScape trade.
So, when I made the items appears in the virtual chest, I want to show info in the lores. (Owner, price, expire date and custom name of the item). I tryed that setting a local variable to the item, changing it's lores, and then showing it in the store. But when the player buys, and gets the item, it has the lores with the info!, I tryed to solve that chaging this other variable that also holds the item {T.ItemListsMirror:number of slot)} changing its lores with the info and when the player buys, give to him {T.ItemLists:number of slot)}. But it dont work either. I dont know what is happing.
Skript Author: Bensku
Minecraft Version: 1.10.2
---
Full Code:
code_language.skript:
#References:
#{T.ItemLists::%arg-1%} = Holds the real item, the one which will be given to the player
#{T.InfoList::%arg-1%} = Holds the price
#{T.OwnerList::%arg-1%} = Holds the nickname of the owner
#{T.ItemListsMirror::%arg-1%} = Holds the real item, but this one will be modify, triying to solve this bug.
#Putting a item for trade in the shop
command /trade [<text>] [<number>] [<number>]:
trigger:
set {_name::*} to uncolored display name of the target entity split at " "
if arg-1 is "add":
if {T.ItemLists::%arg-2%} is set:
send "Slot ocupado"
stop trigger
else:
send "&6&l%{_name::2}%&7: Un gusto negociar!"
set {T.ItemLists::%arg-2%} to player's tool
set {T.ItemListsMirror::%arg-2%} to player's tool
set {T.InfoList::%arg-2%} to arg-3
set {T.OwnerList::%arg-2%} to player
set {T.ExpireList::%arg-2%} to now
add 7 days to {T.ExpireList::%arg-2%}
remove player's tool from player's inventory
stop
#Opening the virtual shop
command /buy:
trigger:
open virtual chest inventory with size 5 named "&7Trade post" to player
wait 1 tick
make a gui slot 0 of player with {BT.BookInfo} to run player command "/trade help"
set {_i} to 0
loop 44 times:
add 1 to {_i}
set {_jho} to {T.ItemListsMirror::%{_i}%}
set {_item} to {_jho} #Here I try to solve the bug, creating temporal variables
set the 1st line of {_item}'s lore to "&6Nombre: &7%{_item}'s name%"
set the 2nd line of {_item}'s lore to "&6Dueño: &7%{T.OwnerList::%{_i}%}%"
set the 3rd line of {_item}'s lore to "&6Precio: &7$%{T.InfoList::%{_i}%}%"
set the 4th line of {_item}'s lore to "&6Expira: &7%{T.ExpireList::%{_i}%}%"
if {_item} is not set:
make a gui slot {_i} of player with arrow named "&7Slot %{_i}% libre" to run player command "/trade slothelp"
make a gui slot {_i} of player with {_item} named "&aSlot %{_i}%" to run player command "/comprar %{_i}%"
delete {_item}
delete {_jho}
#Buying a item command
command /comprar <integer>:
trigger:
send "%arg-1%"
if player's balance is more than {T.InfoList::%arg-1%} - 1:
close player's inventory
wait 1 tick
set {_bal} to player's balance
set player's balance to {_bal} - {T.InfoList::%arg-1%}
send "&c- %{T.InfoList::%arg-1%}%" to player
give {T.ItemLists::%arg-1%} to player #HERE IS WHERE THE SH*T STARTS
send " " to {T.OwnerList::%arg-1%}
send "&a&lTRADER &6&lJhon&r&7: Te han comprado en la tienda! &a&l+$%{T.InfoList::%arg-1%}%" to {T.OwnerList::%arg-1%}
send " " to {T.OwnerList::%arg-1%}
add {T.InfoList::%arg-1%} to player's balance
delete {T.ItemLists::%arg-1%}
delete {T.InfoList::%arg-1%}
delete {T.OwnerList::%arg-1%}
delete {T.ItemListsMirror::%arg-1%}
delete {T.ExpireList::%arg-2%}
else:
send "&cNo tienes suficiente dinero!" to player
Errors on Reload: None
Console Errors: None
Addons using (including versions): Tuske, MundoSK
Troubleshooting: I tryed to make another solid variable,changing its lores for the info, and nothings happends.
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
Another info:
Hi! I have a trouble making a trade sistem. It works on this way.
Players can sell the item to other players in a type of "bazar", a villager that just stands there and receives items from players, and sells them to other players, something like RuneScape trade.
So, when I made the items appears in the virtual chest, I want to show info in the lores. (Owner, price, expire date and custom name of the item). I tryed that setting a local variable to the item, changing it's lores, and then showing it in the store. But when the player buys, and gets the item, it has the lores with the info!, I tryed to solve that chaging this other variable that also holds the item {T.ItemListsMirror:number of slot)} changing its lores with the info and when the player buys, give to him {T.ItemLists:number of slot)}. But it dont work either. I dont know what is happing.