Lớp công cụ
SoundGroup
*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
Tài Liệu Tham Khảo API
Thuộc Tính
Volume
Mẫu mã
Nhóm Âm Thanh
local SoundService = game:GetService("SoundService")
-- tạo một nhóm âm thanh
local soundGroup = Instance.new("SoundGroup")
soundGroup.Parent = SoundService
-- tạo một âm thanh
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://9120386436"
sound.Looped = true
sound.PlaybackSpeed = 2
sound.SoundGroup = soundGroup
sound.Parent = workspace
-- phát âm thanh
sound:Play()
task.wait(10)
-- thay đổi âm lượng
soundGroup.Volume = 0.1
task.wait(3)
-- trả về âm lượng
soundGroup.Volume = 0.5
task.wait(4)
-- thêm một hiệu ứng âm thanh
local reverb = Instance.new("ReverbSoundEffect")
reverb.Parent = soundGroup