Kelas Engine
AudioDeviceInput
*Konten ini diterjemahkan menggunakan AI (Beta) dan mungkin mengandung kesalahan. Untuk melihat halaman ini dalam bahasa Inggris, klik di sini.
Rangkuman
Properti
Metode
GetConnectedWires(pin: string):{Wire} |
SetUserIdAccessList(userIds: {any}):() |
Acara
WiringChanged(connected: boolean,pin: string,wire: Wire,instance: Instance):RBXScriptSignal |
Referensi API
Properti
Muted
Contoh Kode
Tekan-untuk-bicara
local players = game:GetService("Players")
local userInput = game:GetService("UserInputService")
local audioIn: AudioDeviceInput = players.LocalPlayer:WaitForChild("AudioDeviceInput")
audioIn.Muted = true
local pushToTalkKey = Enum.KeyCode.V
userInput.InputBegan:Connect(function(input: InputObject)
-- Jika input adalah tombol untuk berbicara, unmute audio
if input.KeyCode == pushToTalkKey then
audioIn.Muted = false
end
end)
userInput.InputEnded:Connect(function(input: InputObject)
-- Jika input adalah tombol untuk berbicara, mute audio
if input.KeyCode == pushToTalkKey then
audioIn.Muted = true
end
end)Metode
GetConnectedWires
Acara