Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.