local replicatedStorage = game:GetService("ReplicatedStorage") local starterRebirthAmount = 5000
local player = game.Players.LocalPlayer local mainFrame = script.Parent:WaitForChild("MainFrame") local rebirthMenu = mainFrame:WaitForChild("RebirthMenu") local mainButton = script.Parent:WaitForChild("OpenRebirthFrame") local rebirthButton = rebirthMenu:WaitForChild("RebirthButton") local fatToRebirth = mainFrame.RebirthMenu:WaitForChild("StrengthToRebirth") local rebirths = game.Players.LocalPlayer:WaitForChild("leaderstats").Rebirths
rebirthButton.Text = "You need at least "..math.floor((starterRebirthAmount + (rebirths.Value) * math.sqrt(5000000))).." fat to rebirth"
mainButton.MouseButton1Click:Connect(function() mainFrame.Visible = not mainFrame.Visible end)
rebirthButton.MouseButton1Click:Connect(function() local result = replicatedStorage.Rebirth:InvokeServer()
if result == true then
rebirthButton.Text = "Successfully Rebirthed!"
wait(1)
rebirthButton.Text = "Click HERE TO REBIRTH"
elseif result == "NotEnoughStrength" then
rebirthButton.Text = "Not Enough Money!"
wait(1)
rebirthButton.Text = "Click HERE TO REBIRTH"
end
end)
rebirths:GetPropertyChangedSignal("Value"):Connect(function() fatToRebirth.Text = "You need at least"..math.floor((starterRebirthAmount + (rebirths.Value) * math.sqrt(5000000))).."fat to rebirth" end)
