How to make a script that checks if you are on mobile

Maybe KeyboardEnabled can help you.
More help: