PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

IsVoiceEnabledForUserIdAsync

Returns whether or not the given user has voice enabled. On the client-side, this can only be used to check the voice status of the local player.

The following code sample enables a UI layer only for voice enabled players.

local Players = game:GetService(“Players”)
local VoiceChatService = game:GetService(“VoiceChatService”)

local localPlayer = Players.LocalPlayer
local success, enabled = pcall(function()
    return VoiceChatService:IsVoiceEnabledForUserIdAsync(localPlayer.UserId)
end)
if success and enabled then
    localPlayer.PlayerGui.MyVoiceGui.Enabled = true
end

Parameters

Name Type Default Description

The UserId to check.

Returns

Return Type Summary

If that user has voice enabled.