Just to make sure, am I detecting if the player is on mobile correctly?
local function checkIfMobile()
if UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled and not UserInputService.MouseEnabled then
return true
elseif not UserInputService.TouchEnabled and UserInputService.KeyboardEnabled and UserInputService.MouseEnabled then
return false
else
return false
end
end
RunService.Heartbeat:Connect(function()
local result = checkIfMobile()
gui.Enabled = result
end)