Author Topic: [Scripts] Infinite Upgrades (Requested)  (Read 214 times)

0 Members and 1 Guest are viewing this topic.

Lunar

  • Elite Member
  • *****
  • Posts: 938
  • The God of the Galaxy
  • Awards 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: Qvzw
  • PSN: Widumn_Boise
[Scripts] Infinite Upgrades (Requested)
« on: June 08, 2017, 03:20:28 PM »
Script: Infinite Upgrade

var [price] = [history:upgradeprice]
var [gold] = [inv:goldpieces]
// The first variable is set to the price of the upgrade, the second one is set to the amount of gold pieces the player has in their inventory, can be replaced by a history.

If
   IsVar [gold] [<] [price]
Then
   MessageBox [You do not have enough Gold for this!]
Else
   Inventory [player] [take] [goldpieces] [price]
   // Dont confuse the [price] with something you choose, this is a variable.
   History [upgradename] [player] [+1]
   var [newprice] = [price] * [1.5]
   // I set it so the next upgrade cost is 1.5x more, you can change that to whatever you want.
   History [upgradeprice] [player] [newprice]
   MessageBox [Your next upgrade will cost [newprice].]
EndIf