So I am trying to make an rebirth system for my Game
local plr = script.Parent.Parent.Parent.Parent.Parent
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local number_of_times_bought = plr.leaderstats.Rebirths
local current_price = 1000000000 -- start off at 100
script.Parent.MouseButton1Click:Connect(function()
local Short = require(game.ReplicatedStorage.Short)
local plr = script.Parent.Parent.Parent.Parent.Parent
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local number_of_times_bought = plr.leaderstats.Rebirths
local current_price = 1000000000 -- start off at 100
if Player.leaderstats.Coins.Value > current_price then
Player.leaderstats.Rebirths.Value = Player.leaderstats.Rebirths.Value + 1
current_price = 1.1 * current_price
Player.leaderstats.Coins.Value = 0
Player.leaderstats.Gems.Value = 0
end
end)
if Player.leaderstats.Coins.Value < current_price then
print("You dont have have enough coins, You need (current_price)")
end
The requirement to rebirth is 1b and the price would rise everytime u rebirth
This is what I have right now but it isnt working, would be great if someone knows how to fix it