Does ChatService:CanUserChatAsync() return false for Xbox users?

CanUserChatAsync should theoretically always return false for Xbox users, given that they cannot access chat right? If someone could test this out on Xbox and confirm whether or not this is the case that’d be lovely.

1 Like

In Studio, you are able to test the game on different device’s resolution and system, almost like an emulator. Switching it to the xBox One configuration and playing the game, I ran a simple code to check for the function you listed, which – despite my chat being disabled – returned true. Showcased in detail below.

Results of my test

The code that is used to check;

local Players = game:GetService("Players")
local Chat = game:GetService("Chat")

Players.ChildAdded:Connect(function(player)
	game.Workspace.ChildAdded:Connect(function(character)
		local userID = player.UserId
		local canChat = Chat:CanUserChatAsync(userID)
		print(canChat)
	end)
end)


Here you can see that I will run the game in xBox One emulation.

No chat bar, no settings, unable to press ‘/’ to chat.
image
This is the output.


If you want to check which platform the player is from, you can run an additional code to check for both;

Code
local Players = game:GetService("Players")
local Chat = game:GetService("Chat")
local UIS = game:GetService("UserInputService")
local GS = game:GetService("GuiService")

function getPlatform(player)
	if (GS:IsTenFootInterface()) then
		return print("Console")
	elseif (UIS.TouchEnabled and not UIS.MouseEnabled) then
		return print("Mobile")
	else
		return print("Desktop")
	end
end

Players.ChildAdded:Connect(function(player)
	game.Workspace.ChildAdded:Connect(function(character)
		getPlatform(player)
		local userID = player.UserId
		local canChat = Chat:CanUserChatAsync(userID)
		print(canChat)
	end)
end)

When you run this code in the Studio emulator, it returns Console, so it should be accurate from when an actual xBox player joins your game.

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