Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make it if bought one to multipli times a amount?

Asked by 1 year ago

I dont have the best english but I mean when bought the first time its 500 gems and then when bought it does *5 so its 2.5k and then when bought again *5 12.5k again *5 62.5k

I am new to coding so there is probbably a really easy solution but I cant find it

price.Text = ((150)+(rebirthButtonsData.Value*500)).." Gems"

2 answers

Log in to vote
0
Answered by
xXMadonXx 190
1 year ago
Edited 1 year ago
local lastPrice = 500 --Last price
price.Text = lastPrice .. " Gems" --Update Text
lastPrice *= 5 --Set Last price to the new Price
Ad
Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

So you want it to multiply by 5 every time they buy gems?

local value = 500

--//When Button Is Pressed//--
value = value * 5  --Increases the base_value variable by *5
price.Text  = value --Updates the price.Text to the new value


Answer this question