學習
引擎類別
SoundGroup

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡


概要
繼承成員

API 參考
屬性
Volume
平行讀取
功能: LegacySound
SoundGroup.Volume:number
範例程式碼
聲音組
local SoundService = game:GetService("SoundService")
-- 創建一個聲音組
local soundGroup = Instance.new("SoundGroup")
soundGroup.Parent = SoundService
-- 創建一個聲音
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://9120386436"
sound.Looped = true
sound.PlaybackSpeed = 2
sound.SoundGroup = soundGroup
sound.Parent = workspace
-- 播放聲音
sound:Play()
task.wait(10)
-- 改變音量
soundGroup.Volume = 0.1
task.wait(3)
-- 恢復音量
soundGroup.Volume = 0.5
task.wait(4)
-- 添加聲音效果
local reverb = Instance.new("ReverbSoundEffect")
reverb.Parent = soundGroup

©2026 Roblox Corporation、Roblox、Roblox 標誌及 Powering Imagination 是我們在美國及其他國家地區的部分註冊與未註冊商標。