I need to make rebirths please help, the error is: PlayerGui.MainGui.RebirthControl:21: attempt to index function with 'MouseButton1Up'

code

local player = game.Players.LocalPlayer
local RepStor = game:GetService("ReplicatedStorage")
local RebirthFunction = RepStor:WaitForChild("RebirthFunction")
local openRebirthFrame = script.Parent.StatusFrame.Rebrith2:WaitForChild("RebirthOpenButton")
local rebirthFrame = script.Parent.SecondFrame:WaitForChild("RebirthFrame")
local rebirthButton = rebirthFrame.RebirthText:WaitForChild("RebirthButton")
local leaderstats = player:WaitForChild("leaderstats")
local Rebirths = leaderstats:WaitForChild("Rebirths")
function rebirthButton()
	rebirthFrame.Visible = not rebirthFrame.Visible
	rebirthFrame.MultiplierInfo.Text = "Your new multiplier will be " .. Rebirths.Value * 2 .. "X"
end
openRebirthFrame.MouseButton1Up:Connect(rebirthButton)

function rebirth()
	local playerRebirthed = RebirthFunction:InvokeServer()
	if playerRebirthed == true then
		rebirthFrame.MultiplerInfo.Text = "Your new multiplier will be " .. Rebirths.Value * 2 .. "X"
	end
end
rebirthButton.MouseButton1Up:Connect(rebirth)

here is where the code that resets your progress

RebirthFunction.OnServerInvoke = function(player)
	local initKey = "user_" .. player.userId .. "_init"
	local coinsKey = "user_" .. player.userId .. "_coins"
	local invenValKey = "user_" .. player.userId .. "_invenVal"
	local invenCountKey = "user_" .. player.userId .. "_invenCount"
	local backpackKey = "user_" .. player.userId .. "_backpack"
	local pickaxeKey = "user_" .. player.userId .. "_pickaxe"
	local boughtKey = "user_" .. player.userId .. "_bought"
	local rebirthKey = "user_" .. player.userId .. "_rebirth"
	local rebirthMKey = "user_" .. player.userId .. "_rebrithM"
	if player.leaderstats.Coins.Value >= 10 then
		player.leaderstats.Rebirths.Value = player.leaderstats.Rebirths.Value + 1
		dataStore:SetAsync(initKey, true)
		dataStore:SetAsync(coinsKey, 0)
		dataStore:SetAsync(invenValKey, 0)
		dataStore:SetAsync(invenCountKey, 0)
		dataStore:SetAsync(backpackKey, "BackpackBasic")
		dataStore:SetAsync(pickaxeKey, "Basic Pickaxe")
		dataStore:SetAsync(boughtKey, {})
		dataStore:SetAsync(rebirthKey, 0)
		dataStore:SetAsync(rebirthMKey, 0)
	end
end