Client:
local FormatNumber = require(ReplicatedStorage.Libs.FormatNumber.Simple)
local Remotes = ReplicatedStorage.Remotes
local RebirthConfig = require(ReplicatedStorage.Config.Rebirths)
local Player = game:GetService("Players").LocalPlayer
local PlayerGui = Player.PlayerGui
local ButtonGui = PlayerGui:WaitForChild("Main")
local OpenButton = ButtonGui.Main.loop
local Gui = PlayerGui:WaitForChild("Rebirth")
local Frame = Gui.Frame
local Rebirths = Frame.RB
local ExitButton = Frame.Close
local Container = Frame.Container
local template = Container.RBone
local UnlimitedButton = Container.RBinf
local REBIRTH_BUTTON_COST_TEMPLATE = "AMOUNT"
local REBIRTH_BUTTON_REBIRTHS_TEMPLATE = "AMOUNT Rebirths"
local data = {
Rebirths = 0,
RebirthsButtons = {}
}
local function UpdateButtons()
for _, child in Container:GetChildren() do
if not child:IsA("Frame") or child.Name == "RBone" or child.Name == "RBInf" then return end
local clone: typeof(template) = child
clone.Visible = data.RebirthsButtons[clone.Name]
end
end
local function UpdateButtonCosts()
for _, child in Container:GetChildren() do
if not child:IsA("Frame") then return end
local clone: typeof(template) = child
local rebirths = tonumber(clone.Name)
local cost = RebirthConfig.CalculatePrice(data.Rebirths, rebirths)
clone.Buy.Text = FormatNumber.FormatCompact(cost)
end
end```
** You are now Level 1! **