#Introduction
I want to create an immersive roleplay game, but I wish to make an area play a specific audio. For example, the player enters the wilderness, and I want it to play music that is related to that.
As for my attempts, I made two parts; InsidePart and OutsidePart. InsidePart lets the script know that the player has entered the inside of the area. OutsidePart will let the script know if the player has exited the area.
#Scripts
My script inside InsidePart:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
workspace.InsideAudio:Play()
workspace.OutsideAudio:Stop()
end
end)
My script inside OutsidePart:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
workspace.InsideAudio:Stop()
workspace.OutsideAudio:Play()
end
end)
#Conclusion
Any help please? It doesn't work when it's supposed to.
P.S, I heard that placing audio inside of the workspace will play it server-wide, placing audio inside of StarterPlayer will play it client-side. Let me know if you know how to make it play client-side only. Thanks!

2 comments
you could place an invisible part to play the audio and give a specific range in which the audio plays by editing its properties.
Alright, I'll try that later. But what I want is when a player enters the part, it will play the audio. Thanks for the suggestion anyways.