local replicatedStorage = game:GetService("ReplicatedStorage")
local starterRebirthAmount = 1000000

local player = game.Players.LocalPlayer
local mainFrame = script.Parent:WaitForChild("MainFrame")
local rebirthMenu = mainFrame:WaitForChild("RebirthMenu")
local mainButton = script.Parent:WaitForChild("MainButton")
local rebirthButton = rebirthMenu:WaitForChild("RebirthButton")
local strengthToRebirth = rebirthMenu:WaitForChild("StrengthToRebirth")
local rebirths = player:WaitForChild("leaderstats").Darta

strengthToRebirth.Text = "You Need at least "..math.floor((starterRebirthAmount + (rebirths.Value) * math.sqrt(50000000))).."Harta to darta"

mainButton.MouseButton1Click:Connect(function()
	
	mainFrame.Visible = not mainFrame.Visible
	
end)

rebirthButton.MouseButton1Click:Connect(function()
	
	local result = replicatedStorage:FindFirstChild("Remotes").Rebirth:InvokeServer()
	
	if result == true then
		rebirthButton.Text = "Succsesfully darta"
		wait(1)
		rebirthButton.Text = "CLICK HERE TO DARTA"
	         else if result == "NotEnoughHarta"	then
			 rebirthButton.Text = "Not Enough Harta"
			wait(1)
			rebirthButton.Text = "CLICK HERE TO DARTA"
	
	end
	
	end

	rebirths:GetPropertyChangedSignal("Value"):Connent(function()
		strengthToRebirth.Text = "You need at least"..(math.floor((starterRebirthAmount + (rebirths.Value) * math.sqrt(50000000)))).."Harta to Darta"
	end)
	
end)

2 comments

0

Idk where the heck line 22 is but judging from the title, check your spelling.

0

please put all of your code in a code block this hurts my eyes