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

How Do I Script A Stage Ui Which When You Buy A New Stage You Get A Multiplier?

Asked by 3 years ago

https://gyazo.com/116e6b824de97ccdd9c31911a60df7b2 Like This I Want It Like I Buy A New Stage Then All My Coins Go To 0 And I Get A Multiplier Like 2x Times Coins And Gems For Stage One And For Stage 2 4x times coins and gems. I Haven't Tried Anything Yet

0
no script requests, sorry AnasBahauddin1978 715 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

I would in a module do something like this

local module = {
    ['Stage 1'] = {
        Multiplier = 1,
    },
    ['Stage 2'] = {
        Multiplier = 2,
    },
    ['Stage 3'] = {
        Multiplier = 4,
    },
}

return module

in the script you add coins and gems in do

local module = require(module from above)

local stage = player.Stage.Value -- string value
player.leaderstats.Coins.Value += 1 * module[stage].Multiplier

get next stage

if player.leaderstats.Coins.Value > certainAmount then
    player.leaderstats.Coins.Value = 0
    player.Stage.Value = stage name
end
Ad

Answer this question