--watch the video to know where to put it

local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:FindFirstChild("Rebirth")

local button = script.Parent

local debounce = false

button.MouseButton1Click:Connect(function()
	local rebirths = game.Players.LocalPlayer.leaderstats:FindFirstChild("Rebirths")
	if not debounce then
		debounce = true
		local playerPoint = rebirths
		remote:FireServer(playerPoint)
		wait(0.001)
		debounce = false
	end
end)

repeat
	local rebirths = game.Players.LocalPlayer.leaderstats:FindFirstChild("Rebirths")
	local textButton = script.Parent
	textButton.Text = "".. tostring(1000000 * (rebirths.Value + 1)) .." Cash "
	wait(0.001)
until script.Parent == nil
