How do make it when a player is receiving coins there coins multiply by the value of rebirths they have

So basically I would like to make when a player is receiving coins there coins multiply by the value of rebirths they have for example if the person has 25 rebirths, when they are going to receive the coins it multiplies my 25

You can store the rebirth value and use a module, function, etc to work out how much theyâ€™ll make. I.e, theyâ€™ve rebirthed 10 times and pick up a coin worth 5 so the function returns 5 x 10 = 50.

This will, however, mean that youâ€™ll end up having to store the rebirth value for use within programs.

coin.value = coin.value + (what ever amount the coin gives)^(amount of rebirths)

^ means times

I did not and I know this isnt the correct way to use the script and math but hope it gives you an idea

Yes I was thinking about that

Like I can use a script that says

``````local rebirth = leaderstats.rebirth.Value
5 ^ rebirth --and the rest``````

Ok thank you I will try it, I will use a mouse button click function to activate it

I think the best way to have a system like this is to use a module and DataStores to record what rebirth someone is at; howeverâ€¦ to do something like thatâ€¦ I recommend just multiplying each amount of coins by the rebirth levelâ€¦ (i.e: Rebirth 1 = x1, Rebirth 2 = x2, Rebirth 3 = x3, and so on and so fourth)

The best way to do something like this is to get a bunch of friends to test it, then do private testing to see what people like or at the very least; see what you like but no matter whatâ€¦ I recommend multiplying whatever the coins are by a certain amount for each Rebirth.

1 Like

Yes that is what I and trying to do but I think Im doing it correct

``````local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
coins.Value = coins.Value + 5 ^ rebirth.Value
end)``````

That is perfectly how I imagined it
if you want to change the coin to a touch to activate system then you can change

script.Parent.MouseButton1Click:Connect(function()

to

script.Parent.Touched:Connect(function()

I would assume this script is a local script inside the player? because you used
local player = game.Players.LocalPlayer

if you want it inside the Coin then change it to a regular script and do

``````coins.Value = coins.Value + 5 ^ rebirth.Value