local function V(V)local K=player.PlayerGui for K,q in ipairs(K:GetChildren())do if q:IsA("\071\117\105\079\098\106\101\099\116")and q.Name~="\084\117\116\111\114\105\097\108"then q.Enabled=V end end end local function K()V(false)Panels.Visible=true Panel1.Visible=true Panel2.Visible=false end local function q(K,q)if Panel1.Visible==true then Panel1.Visible=false Panel2.Visible=true NextButton.ButtonLabel.Text="\071\079\084 \073\084"elseif Panel2.Visible==true then Panel2.Visible=false Panels.Visible=false V(true)if not IS_MOBILE then Arrow.Visible=true local V=coroutine.create(function()local V=totalPoints.Value+10 local K=Arrow.Position repeat Arrow:TweenPosition(UDim2.new(K.X.Scale,0,K.Y.Scale,-20),Enum.EasingDirection.In,Enum.EasingStyle.Quad,1,true)wait(1)Arrow:TweenPosition(UDim2.new(K.X.Scale,0,K.Y.Scale,0),Enum.EasingDirection.In,Enum.EasingStyle.Quad,1,true)wait(1)until totalPoints.Value>=V Arrow.Visible=false end)coroutine.resume(V)end end end

local function toggleNonTutorialGui(isEnabled)
	local PlayerGui = player.PlayerGui
	
	for _, child in ipairs(PlayerGui:GetChildren()) do
		if child:IsA("GuiObject") and child.Name ~= "Tutorial" then
			child.Enabled = isEnabled
		end
	end
end

local function startTutorial()
	toggleNonTutorialGui(false)
	
	Panels.Visible = true
	Panel1.Visible = true
	Panel2.Visible = false
end

local function nextPanel(input, gameProcessed)
	if Panel1.Visible == true then
		Panel1.Visible = false
		Panel2.Visible = true
		NextButton.ButtonLabel.Text = "GOT IT"
	elseif Panel2.Visible == true then
		Panel2.Visible = false
	
		-- Disable tutorial
		Panels.Visible = false
		
		-- Enable other gui
		toggleNonTutorialGui(true)
		
		if not IS_MOBILE then
			-- Show and tween arrow over move button until player earns
			-- 10 points
			Arrow.Visible = true
			local arrowThread = coroutine.create(
				function()
					local goal = totalPoints.Value + 10
					local startPos = Arrow.Position
			
					repeat
						Arrow:TweenPosition(UDim2.new(startPos.X.Scale, 0, startPos.Y.Scale, -20),
							Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1, true)
						wait(1)
						Arrow:TweenPosition(UDim2.new(startPos.X.Scale, 0, startPos.Y.Scale, 0),
								Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1, true)
						wait(1)
					until totalPoints.Value >= goal
	
					Arrow.Visible = false
				end)
			coroutine.resume(arrowThread)
		end
	end
end

