👍 If you enjoyed the video, leave a like and subscribe, it helps the channel out a lot!
Script:
local AreaSounds = Instance.new("Sound", script)
AreaSounds.Looped = true
local plr = script.Parent
local Presser = plr:WaitForChild("HumanoidRootPart")
local DifferentAreas = workspace:WaitForChild("Areas")
local CurrentArea = nil
game:GetService("RunService").Heartbeat:Connect(function()
local raycast = Ray.new(Presser.Position, Presser.CFrame.UpVector * -1000)
local part = workspace:FindPartOnRayWithWhitelist(raycast, {DifferentAreas})
if part and part.Parent == DifferentAreas then
if part ~= CurrentArea then
CurrentArea = part
AreaSounds.SoundId = CurrentArea.Sound.SoundId
AreaSounds:Play()
end
else
CurrentArea = nil
AreaSounds:Stop()
end
end)
Tags:
roblox music in different areas,roblox how to play music in different parts of your game,roblox music areas,roblox music tutorial,roblox how to play sound in different places,roblox different sound environments,roblox play sound in building,roblox scripting tutorial,roblox sound environments,roblox studio,add music roblox game,background music roblox game,how to add music to your roblox game,how to add sound to brick roblox,how to get music on your roblox game 2016, roblox studio make sound region,roblox studio how to make sound region,roblox studio how to make sound regions,roblox studio how to make sound regions area,roblox studio create sound region
Негізгі бет 🔊 How To Add Music In Different Areas | Roblox Studio
Пікірлер: 3