I made admin commands (as you can see on me Scripting Helpers profile), and for those I made a ScreenGui that has a ImageLabel . I want to be in a certain position when player joins on a certain device. I think I know the code for it, I just need to know where to get the device from
✓ ANSWER ACCEPTED
How to check what device a player is on?
2 answers
✓ Accepted answer
What you will be needing is UserInputService. You can learn more about it here.
Anyways here the code you will need:
local UserInputService = game:GetService("UserInputService")
if UserInputService.GamepadEnabled then
print("Player is playing using an Xbox")
elseif UserInputService.KeyboardEnabled then
print("Player is playing on a pc")
elseif UserInputService.TouchEnabled then
print("Player is playing on mobile")
end
Hope it helps!
local UserInputService = game:GetService("UserInputService")
function checkdevice()
if (UserInputService.KeyboardEnabled) then
return "PC"
elseif (UserInputService.GamepadEnabled) then
return "Console"
elseif (UserInputService.VREnabled) then
return "VR"
elseif (UserInputService.TouchEnabled) then
return "Mobile"
end
end
print(checkdevice())
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
thanks ill try it
thanks this really helped!
No worries! Glad to help out :D