Can you detect if player is on PlayStation rather than Xbox?

I am trying to have different UI depending on if the player is on PlayStation or Xbox, as they don’t have the same button layout.

I haven’t been able to find an exact solution, the only resources I could find were outdated or irrelevant.

I am aware on how to detect what platform they are on by using UIS, just not how to differentiate between PlayStation and Xbox.

In the script, I am giving the player different UI based on their platform.

local prompt = workspace:WaitForChild("Part"):WaitForChild("ProximityPrompt")
local plr = game:GetService("Players").LocalPlayer
local pickGui = game:GetService("ReplicatedStorage"):WaitForChild("lockpickUI")
local UIS = game:GetService("UserInputService")

prompt.Triggered:Connect(function()
	if UIS.KeyboardEnabled then
		prompt.Enabled = false
		local plrPick = pickGui.lockpickPC:Clone()
		plrPick.Parent = plr.PlayerGui
	end
	if UIS.TouchEnabled then
		prompt.Enabled = false
		local plrPick = pickGui.lockpickMobile:Clone()
		plrPick.Parent = plr.PlayerGui
	end
	if UIS.GamepadEnabled then
		--would detect xbox or playstation--
	end
end)

try checking this out! hope this helps.

Looked through it, I think I could figure it out from that info, thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.