VoiceChatService

非推奨を表示
作成できません
サービス

VoiceChatService holds voice functions not tied to other instances.

概要

プロパティ

方法

プロパティ

EnableDefaultVoice

並列読み取り
プラグインのセキュリティ

Indicates whether or not the place uses the default voice manager. This is enabled by default.

When enabled, the default voice manager adds all voice-eligible users to voice chat as they join the place. When disabled, the place doesn't use the default voice manager, and users are not added to voice chat when they join the place.

並列読み取り
プラグインのセキュリティ

方法

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. On the server-side, this can only check the voice status for players in that server.

This function can throw an error if the HTTP call fails.

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

パラメータ

userId: number

The UserId to check.


戻り値

If that user has voice enabled.

イベント