i have tried to get the double cost to work in a kinds of ways but it never seems to work. This is one of the attempts:
local player= game. Players, Localplayer local Coins= player.leaderstats:FindFirstChild("Coins") local Rebirths = player.leaderstats:FindFirstChild( "Rebirths") local price = script. Parent.Price.Value local amount= script.Parent.Amount.Value script.Parent.MouseButton1Click:Connect(function() if Coins.Value >= price then Coins.Value = 0 Rebirths.Value += amount price = price * 2 end end)
This script should work.
local player = game.Players.LocalPlayer local Coins = game.leaderstats:FindFirstChild("Coins") local Rebirths = player.leaderstats:FindFirstChild("Rebirths") local price = script.Parent.Price.Value local amount = script.Parent.Amount.Value script.Parent.MouseButton1Click:Connect(function() if Coins.Value >= price then Coins.Value -= price end Rebirths.Value += amount price = price * 2 end)