Will This Work To Detect A Player Being On Xbox?


local isOnXbox = game:GetService('GuiService').IsTenFootInterface

if isOnXbox == true then
    script.Parent.Visible = false
    script.Parent.Parent.XboxButtons.Visible = true

I currently don’t have access to my Xbox.


IsTenFootInterface is a method, not a property, but aside from that it’s fine. It shouldn’t need the wait.

1 Like

It is considered a bool on the wiki, which is why I added in the ‘true’ statement.

I have a feeling it requires the wait function as the same code wouldn’t work previously when running.

Here is the game if you have an Xbox you can test the game on.
Start screen should say “Press A To Continue.”

It currently doesn’t support PCs with a gamepad plugged in, but I’ll be fixing that.

1 Like

It returns a bool, but it’s not one. The new wiki design is a bit weird compared to the old one, but the API reference still gives you heaps of clues.

Since this is running on the client, and the information you are requesting is basically just hardware information, it should work without a wait. Not sure why it wouldn’t work previously, but if it’s a problem with code actually running then you are doing something else wrong :wink:

1 Like

I’ll look into this.

Thanks! :slight_smile:

1 Like

You should check if a gamepad is connected instead of checking if they’re on console in-case someone has an xbox controller plugged into their computer


1 Like

I’d proceed with caution. A lot of players may have a controller plugged in (especially if it’s using a wireless adapter) and will look like they are playing exclusively on console. Always assume players are on PC when using this method :slight_smile:

Tru tru

A better way would be to do something like

local UIS = game:GetService("UserInputService")

function UpdateUI(LastInputType)

    local isUsingGamepad = LastInputType == Enum.UserInputType.Gamepad1

    --Do whatever


You shouldn’t be detecting if players are on an Xbox, you should be detecting if they’re using a controller. If a player has a controller plugged in but is using a mouse/keyboard, show the PC menu once they use either input device. Until then, show them the Xbox menu.

1 Like

What can I do about the start screen in my game?

What about the start screen for your game? They’ll eventually move their mouse or use the gamepad, the same principle applies.

It will say “Press Any Key” for PC and “Press A to continue”

It’s the first thing that players will see when they enter my game.

Replace that with a button to play instead. Both PC players and Xbox players can click buttons.

This coupled with a BindableEvent solved my issue.

Thank you! :slight_smile:

1 Like