LocalScript Not Working

local players = game.Players -- references players
local player = players.LocalPlayer -- references player script is inside of
local mouse = player:GetMouse() -- references players mouse
local replicatedStorage = game:GetService("ReplicatedStorage") -- references replicated storage
local remoteFolder = replicatedStorage:FindFirstChild("Remotes") -- references remotes folder
local remoteEvent = remoteFolder.RemoteEvent -- references remote event

local leaderstats = player:WaitForChild("leaderstats")
local playerStats = player:WaitForChild("Stats")
local coins = leaderstats.Coins
local gems = leaderstats.Gems
local clicks = playerStats.Clicks
local backpackSize = playerStats.BackpackSize

local statLabelGUI = script.Parent:FindFirstChild("StatLabels")
local clicksFrame = statLabelGUI.ClickFrame
local clickLabel = clicksFrame.ClickLabel
local coinFrame = statLabelGUI.CoinFrame
local coinLabel = coinFrame.CoinLabel
local gemFrame = statLabelGUI.GemFrame
local gemLabel = gemFrame.GemLabel



function onClick()
	mouse.Button1Down:Connect(function() -- when left click
		remoteEvent:FireServer("Click") -- fires remote to server with click parameter
	end)
end

function formatNumber(number)
	local formatted = number
	while true do
		formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
		if (k==0) then
			break
		end
	end
	return formatted
end


function loadLabelValues()
	local function updateValues()
		clickLabel.Text = formatNumber(clicks.Value)
		coinLabel.Text = formatNumber(coins.Value)
		gemLabel.text = formatNumber(gems.Value)
	end
	clicks:GetPropertyChangedSignal("Value"):Connect(function()
		updateValues()
	end)
	coins:GetPropertyChangedSignal("Value"):Connect(function()
		updateValues()
	end)
	gems:GetPropertyChangedSignal("Value"):Connect(function()
		updateValues()
	end)
	backpackSize:GetPropertyChangedSignal("Value"):Connect(function()
		updateValues()
	end)
end

function main()
	onClick()
	loadLabelValues()
end


main()

No errors, but labels do not change at all.

Place prints and see if the code is running at all.

when i put a print statement in the main funcfion it works

How about every other function?

Tested and they print at end of function