Как Сделать AMBIENT? | Roblox Studio
Спасибо за просмотр! Обязательно назовите папку так как в скрипте! ___________________________Script_________________________________ \ / local ServerStorage = game:GetService("ServerStorage") local SoundFolder = ServerStorage:WaitForChild("Ambient") local Sounds = SoundFolder:GetChildren() while true do local delay = math.random(10, 20) wait(delay) -- 1. Создаём невидимую часть для звука local soundPart = Instance.new("Part") soundPart.Anchored = true soundPart.Size = Vector3.new(1, 1, 1) soundPart.Transparency = 1 -- Делаем невидимой soundPart.CanCollide = false soundPart.Position = Vector3.new( math.random(-50, 50), 0, math.random(-50, 50) ) soundPart.Parent = workspace -- 2. Добавляем звук к части local randomSound = Sounds[math.random(1, #Sounds)]:Clone() randomSound.Parent = soundPart -- Важно: звук должен быть в Part! randomSound:Play() -- 3. Удаляем после проигрывания randomSound.Ended:Wait() soundPart:Destroy() end __________________________________________________________________
Спасибо за просмотр! Обязательно назовите папку так как в скрипте! ___________________________Script_________________________________ \ / local ServerStorage = game:GetService("ServerStorage") local SoundFolder = ServerStorage:WaitForChild("Ambient") local Sounds = SoundFolder:GetChildren() while true do local delay = math.random(10, 20) wait(delay) -- 1. Создаём невидимую часть для звука local soundPart = Instance.new("Part") soundPart.Anchored = true soundPart.Size = Vector3.new(1, 1, 1) soundPart.Transparency = 1 -- Делаем невидимой soundPart.CanCollide = false soundPart.Position = Vector3.new( math.random(-50, 50), 0, math.random(-50, 50) ) soundPart.Parent = workspace -- 2. Добавляем звук к части local randomSound = Sounds[math.random(1, #Sounds)]:Clone() randomSound.Parent = soundPart -- Важно: звук должен быть в Part! randomSound:Play() -- 3. Удаляем после проигрывания randomSound.Ended:Wait() soundPart:Destroy() end __________________________________________________________________



