Lớp công cụ
AudioDeviceInput
*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.
Tóm Tắt
Thuộc Tính
Phương Pháp
GetConnectedWires(pin: string):{Wire} |
SetUserIdAccessList(userIds: {any}):() |
Sự Kiện
WiringChanged(connected: boolean,pin: string,wire: Wire,instance: Instance):RBXScriptSignal |
Tài Liệu Tham Khảo API
Thuộc Tính
Muted
Mẫu mã
Nhấn để nói
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)
if input.KeyCode == pushToTalkKey then
audioIn.Muted = false
end
end)
userInput.InputEnded:Connect(function(input: InputObject)
if input.KeyCode == pushToTalkKey then
audioIn.Muted = true
end
end)Phương Pháp
GetConnectedWires
Sự Kiện