if not game:IsLoaded()then game.Loaded:Wait()end local a=game.Players.LocalPlayer local w=a:WaitForChild("\073\110\071\097\109\101")local j=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local O=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local T=script.Parent local H=T.Default local n=T.Mobile local C=j:WaitForChild("\071\097\109\101")local P=require(C.Modules:WaitForChild("\073\115\077\111\098\105\108\101"))local function I()local a=P.isMobile()H.Visible=not a n.Visible=a end I()O.InputBegan:Connect(function(a,w)if a.UserInputType==Enum.UserInputType.MouseMovement and(O.MouseEnabled and n.Visible)then I()elseif a.UserInputType==Enum.UserInputType.Touch and(not O.MouseEnabled and H.Visible)then I()end end)local function M()T.Enabled=w.Value end w.Changed:Connect(M)M()
--Kyles45678

if not game:IsLoaded() then
	game.Loaded:Wait()
end

local ply = game.Players.LocalPlayer
local inGame = ply:WaitForChild("InGame")

local repStoreService = game:GetService("ReplicatedStorage")
local userInputService = game:GetService("UserInputService")

local gui = script.Parent

local defaultView = gui.Default
local mobileView = gui.Mobile

local gameFolder = repStoreService:WaitForChild("Game")
local IM = require(gameFolder.Modules:WaitForChild("IsMobile"))

local function toggleGameUI()
	local ism = IM.isMobile()
	defaultView.Visible = not ism
	mobileView.Visible = ism
end

toggleGameUI()

userInputService.InputBegan:Connect(function(inputObj, GPE)
	--if GPE then return end
	if
		inputObj.UserInputType == Enum.UserInputType.MouseMovement
		and userInputService.MouseEnabled
		and mobileView.Visible
	then
		toggleGameUI()
	elseif
		inputObj.UserInputType == Enum.UserInputType.Touch
		and not userInputService.MouseEnabled
		and defaultView.Visible
	then
		toggleGameUI()
	end
end)

local function onInGameChange()
	gui.Enabled = inGame.Value
end

inGame.Changed:Connect(onInGameChange)
onInGameChange()
