Quick Scoop

To detect PC vs Xbox vs PlayStation in Roblox, the most reliable approach is usually to check the player’s input type, not try to read the exact console model directly. Roblox DevForum guidance says UserInputService.GamepadEnabled only tells you that a gamepad is active, and GetStringForKeyCode(Enum.KeyCode.ButtonA) can help distinguish Xbox from PlayStation because it returns different button names like ButtonA or ButtonCross depending on the controller mapping.

How it works

  • PC: KeyboardEnabled is often true, and GamepadEnabled may be false unless a controller is connected.
  • Xbox / PlayStation: GamepadEnabled becomes true, but that alone does not tell you which console it is.
  • Xbox vs PlayStation: a common community method is checking what GetStringForKeyCode(Enum.KeyCode.ButtonA) returns, then mapping ButtonA to Xbox and ButtonCross to PlayStation.

Simple Lua example

lua

local UIS = game:GetService("UserInputService")

local function getDeviceType()
	if UIS.KeyboardEnabled then
		return "PC"
	end

	if UIS.GamepadEnabled then
		local buttonAName = UIS:GetStringForKeyCode(Enum.KeyCode.ButtonA)
		if buttonAName == "ButtonCross" then
			return "PlayStation"
		elseif buttonAName == "ButtonA" then
			return "Xbox"
		end
		return "Controller"
	end

	return "Unknown"
end

print(getDeviceType())

This kind of logic is mainly useful for showing the right button icons or UI prompts, since Roblox developers note there is no fully official, guaranteed platform detector for Xbox vs PlayStation.

Important limits

  • A controller connected to a PC can look similar to a console input, so input detection is safer than assuming platform.
  • GamepadEnabled means “a gamepad is present,” not “this is definitely Xbox.”
  • For best results, many developers update UI based on the player’s current input mode rather than trying to hard-detect the device itself.

Practical use

If your goal is button prompts, do this:

  1. Detect keyboard, touch, or gamepad input.
  1. If gamepad is used, check the mapped button name to choose Xbox or PlayStation icons.
  1. Fall back to generic controller UI if the mapping is unclear.

TL;DR

Use KeyboardEnabled for PC-style input, GamepadEnabled for controller input, and GetStringForKeyCode(Enum.KeyCode.ButtonA) to separate Xbox from PlayStation in many cases.