Hello again!
I think this time I have a more serious problem, or maybe not who knows?
In my game, I created a shop in which a player can buy weapons, shields, etc etc. At the beginning, the player has a set amount of money, but that amount is not enough to buy all things currently in the shop. In the earlier passage Iâve pasted this:
{
(set: $credits to 3000)
(set: $blaster2 to 0)
(set: $shieldprojector to 0)
}
And in the shop:
The most easiest things to find and buy on Nar Shaddaa were drugs, weapons, and anything banned for which one could get in serious trouble in worlds such as Coruscant or Corellia.
Many vendors of different species offered their merchandise to the locals and tourists. One small shop, owned by a blue-skinned Twiâlek male, sell advanced cybernetic implants of unknown origins.
A few shops further, an old greenish Toydarian male sell weapons and defensive technology. If I wanted to buy new weapons, defence gear, or recharge the power of
(if: $shieldprojector is 1)[ my shield projector,]\
(else:)[ an energy shield projector,]
his shop named Gerruâs Weaponry was the place to go.
I entered the shop and began to browse, while prices were relatively fair, I had to remember I had
(colour: orange)|credits>[$credits]
credits so I had to chose carefully.
ââ- Weapons -ââ
While the Toydarian had a broad range of weapons, I wasnât interested in rifles and other crowd-control weapons. I always carried one blaster with me since I would fell uncomfortable carrying more firearms. If anything, I could but myself a better blaster pistol.
{(if: $credits >=1200 and $blaster2 is 0)[(link: "DL-44 heavy blaster pistol")[(colour: yellow)[I bought the DL-44 heavy blaster pistol
(set: $blaster2 to 1)(set: $credits to it -1200)
(replace: ?credits)[$credits]]]]\
(if: $credits <1200)[(colour: yellow)[I don't have enough credits to buy the Dl-44 heavy blaster pistol]]\
(if: $blaster2 is 1)[(colour: yellow)[I already have the DL-44 heavy blaster pistol]] - a very expensive weapon, which was considered to be one of the most powerful blaster pistols in the galaxy. Cost: 1200 credits (13dmg - 17dmg per shoot)}
ââ- Defensive Technology -ââ
{(if: $credits >=2500 and $shieldprojector is 0)[(link: "Personal energy shield projector")[(colour: yellow)[I bought the personal energy shield projector(set: $shieldprojector to 1)(set: $credits to it -2500)(replace: ?credits)[$credits]]]]\
(if: $credits <2500)[(colour: yellow)[I don't have enough credits to buy the personal energy shield projector]]\
(if: $shieldprojector is 1)[(colour: yellow)[I already have the personal energy shield projector]] - a defensive technology that projected a field of energy that protected the user from blaster fire, the elements, or other hazards. Most were small enough to be worn on a belt or arm, or were designed to be held much like a traditional physical shield. Cost: 2500 credits (100 shield power)}
[[back->merchant areas]]
The player has two links and when he clicks one, the amount of credits changes and the designated text in yellow colour appears. Everything works fine but thereâs one problem. After clicking one link, the other one is still clickable despite that the player doesnât have the right amount of money. He can still buy the second item and the amount of credits in orange changes to -$credits.
How to make so that if he doesnât have enough money, the second link changes to the yellow text which points out that he doesnât have the right amount of money? Something with replace and if maybe?