local E=tutorialGUI:WaitForChild("\066\097\099\107\066\117\116\116\111\110")local R=playGUI:WaitForChild("\069\120\105\116\066\117\116\116\111\110")local S=tutorialGUI:WaitForChild("\069\120\105\116\066\117\116\116\111\110")local l=playGUI:WaitForChild("\084\117\116\111\114\105\097\108")local g=playGUI:WaitForChild("\080\108\097\121\071\097\109\101")local function j()tutorialGUI.Visible=false playGUI.Visible=false end local function r()tutorialGUI.Visible=false playGUI.Visible=true end local function X()tutorialGUI.Visible=true playGUI.Visible=false end local function n()ClientTriggerGame:FireServer()j()end R.MouseButton1Click:Connect(j)S.MouseButton1Click:Connect(j)E.MouseButton1Click:Connect(r)g.MouseButton1Click:Connect(n)l.MouseButton1Click:Connect(X)proximityPlay.Triggered:Connect(r)toggleRideHUD.OnClientEvent:Connect(j)
-- Buttons
local tutorialBackButton = tutorialGUI:WaitForChild("BackButton")
local exitButtonPlay = playGUI:WaitForChild("ExitButton")
local exitButtonTutorial = tutorialGUI:WaitForChild("ExitButton")

local pressTutorial = playGUI:WaitForChild("Tutorial")
local pressGame = playGUI:WaitForChild("PlayGame")

local function exit()
	tutorialGUI.Visible = false
	playGUI.Visible = false
end

local function openPlayGUI()
	tutorialGUI.Visible = false
	playGUI.Visible = true
end

local function openTutorialGUI()
	tutorialGUI.Visible = true
	playGUI.Visible = false
end

local function triggerNewGame()
	-- call the remote event to fire the bindable event
	ClientTriggerGame:FireServer()
	exit()
end

exitButtonPlay.MouseButton1Click:Connect(exit)
exitButtonTutorial.MouseButton1Click:Connect(exit)
tutorialBackButton.MouseButton1Click:Connect(openPlayGUI)

pressGame.MouseButton1Click:Connect(triggerNewGame)
pressTutorial.MouseButton1Click:Connect(openTutorialGUI)

proximityPlay.Triggered:Connect(openPlayGUI)
toggleRideHUD.OnClientEvent:Connect(exit)
