#change color in text

1 messages · Page 1 of 1 (latest)

valid siren
#
    set {Qtext} to "&bCost: ↔ &a%{Cost::%player's uuid%}%"
    if player is sneaking:
        set metadata tag "Upgrade" of player to chest inventory with 3 rows named "&bUpgrade"
        if {Meter::%player's uuid%} >= {Cost::%player's uuid%}:
            set slot 10 of metadata tag "Upgrade" of player to leather boots named "&bQuality" with lore "%{Qtext}%" and "&7Lvl: %{Skate::%player's uuid%}%" and "" and "&7Upgrade this to get more" and "&7currency when you walk!"
        else:
            replace "&a" in {Qtext} with "&c"```
i am trying to only change the color of the text if you do not have enough currency. what is the best way to do it?
frank whale
#

What part of it give you an error?

valid siren
#

nothing, it just doesnt display {Qtext}

midnight portal
#

You never used qtext

#

After making it red

#

Also you should probably make qtext a local var

valid siren
#

i did use it

#

with lore "%{Qtext}%"\

midnight portal
#

Not in the else

runic quiver
#

found the error

#

@valid siren
you need to "refresh" the item if you change the variable, you make it if meter is bigger then cost = set slot to the item else: change the color, but you never refreshed the item

on left click:
    set {Qtext} to "&bCost: ↔ &a%{Cost::%player's uuid%}%"
    if player is sneaking:
        set metadata tag "Upgrade" of player to chest inventory with 3 rows named "&bUpgrade"
        if {Meter::%player's uuid%} >= {Cost::%player's uuid%}:
            set slot 10 of metadata tag "Upgrade" of player to leather boots named "&bQuality" with lore "%{Qtext}%" and "&7Lvl: %{Skate::%player's uuid%}%" and "" and "&7Upgrade this to get more" and "&7currency when you walk!"
        else:
            replace "&a" in {Qtext} with "&c"
            set slot 10 of metadata tag "Upgrade" of player to leather boots named "&bQuality" with lore "%{Qtext}%" and "&7Lvl: %{Skate::%player's uuid%}%" and "" and "&7Upgrade this to get more" and "&7currency when you walk!"

this worked for me

valid siren
#

so there is no easy way

#
    if player is sneaking:
        set metadata tag "Upgrade" of player to chest inventory with 3 rows named "&bUpgrade"
        if {Meter::%player's uuid%} >= {Cost::%player's uuid%}:
            set slot 10 of metadata tag "Upgrade" of player to leather boots named "&bQuality" with lore "&bCost: ↔ &a%{Cost::%player's uuid%}%" and "&7Lvl: %{Skate::%player's uuid%}%" and "" and "&7Upgrade this to get more" and "&7currency when you walk!"
        else:
            set slot 10 of metadata tag "Upgrade" of player to leather boots named "&bQuality" with lore "&bCost: ↔ &c%{Cost::%player's uuid%}%" and "&7Lvl: %{Skate::%player's uuid%}%" and "" and "&7Upgrade this to get more" and "&7currency when you walk!"```because i had this before and wanted to make it shorter
runic quiver
midnight portal
#

There is

#

Just set the item after the if