Solved Changing lores to temporal variable affects solid variable.

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

krainser

Member
Jan 27, 2017
60
3
3
34
Argentina
Skript Version: 2.2-dev31c
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::emoji_frowning:number of slot)} changing its lores with the info and when the player buys, give to him {T.ItemLists::emoji_frowning:number of slot)}. But it dont work either. I dont know what is happing.
 
You can set a variable for each of the items original traits, and another variable for the traits displayed in the gui, so “set {lore.original} to the items lore”, and “set {lore.display} to ___” whatever you want the item in the gui to display, I did a pretty bad job at trying to explain this but I will reply tomorrow with an example if you reply :emoji_slight_smile:.
 
T
You can set a variable for each of the items original traits, and another variable for the traits displayed in the gui, so “set {lore.original} to the items lore”, and “set {lore.display} to ___” whatever you want the item in the gui to display, I did a pretty bad job at trying to explain this but I will reply tomorrow with an example if you reply :emoji_slight_smile:.
Yes! i tought that would work, but it didnt, i use {T.ItemLists::*} and {T.ItemListsMirror::*} instead
 
Status
Not open for further replies.