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
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())