PcoWSkbVqDnWTu_dm2ix
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.