-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================

local function setActive(args)
	local active = false
	if #args >= 1 then
		active = args[1]
	else
		return
	end

	if not active then
		-- Hide racing GUIs
		local PlayerGui = player.PlayerGui
		local TopBar = PlayerGui:FindFirstChild("TopBar")
		TopBar.Enabled = false
	end
end -- setActive

local function checkpointEvent(args)
	for _, arg in pairs(args) do
		if arg[1] == "setActive" then
			table.remove(arg, 1)
			setActive(arg)
		end
	end
end -- checkpointEvent()