Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to detect the players device using?

1 answer

I just found out about this randomly, you can use the below code (in a local script):

if UserInputService.KeyboardEnabled then
	print("Has a keyboard")
else print("No keyboard Availible")
end

Obviously, if the player has a keyboard, they are on PC. If no keyboard is found, they are using a mobile or xbox device.

But you can also use GamepadEnabled and VREnabled to distinguish non-PC players

1 comment

0

Ya this get problematic when a player connects a controller to a phone/pc or a mouse & keybaord to an xbox/phone; generally you want to avoid scripts in Roblox that require device specific factors; learned this the REALLY hard way :P

This discussion is preserved as it was. New answers, comments, and votes are closed.