Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

My SoundRegions are not playing music can i get some help please?

Asked by 8 days ago

So i am working on a game with my friend where each area plays different music like the very 1st version of his game, and i don't know how but the sound regions are not playing the music we tried different scripts but i never worked so if i could have some help that would be nice! Its a local script and it still isn't working BTW

local SoundRegionsWorkspace = game.Workspace:WaitForChild("SoundRegions")

local Found = true

while wait(1)do

    for i, v in pairs(SoundRegionsWorkspace:GetChildren())do

        Found = false
        local region = Region3.new(v.Position - (v.Size/2),v.Position + (v.Size/2))

        local parts =  game.Workspace:FindPartsInRegion3WithWhiteList(region, game.Players.LocalPlayer.Character:GetDescendants())


        for _, part in pairs(parts)do
            -- Loop thingie
            if part:FindFirstAncestor(game.Players.LocalPlayer.Name) then
                print('Player was found')
                Found = true
                break
            else
                Found = false
                print('Player was not found in region')
            end
        end

        if Found == true then
            -- Start playing music
            if script.Parent.SoundRegions[v.Name].IsPlaying == false then
                script.Parent.SoundRegions[v.Name]:Play()
                break
            end
        else
            script.Parent.SoundRegions[v.Name]:Stop()
        end
    end
end

1 answer

Log in to vote
0
Answered by 8 days ago

here u go

https://www.roblox.com/library/5689779375/For-arceusskullgod

0
its uhh not on sale arceusskullgod 2 — 8d
0
damnit my bad lol should be working now sorry for the wait Dev_Zephyr -5 — 8d
Ad

Answer this question