What do you want to achieve?
When the player touches this invisible wall/meaning they enter the building, this sound effect inthe sound will enable.
What is the issue?
local pitch = game.Workspace.Sound.ReverbSoundEffect
script.Parent.Touched:Connect(function()
if pitch.Enabled == false then
pitch.Enabled = true
else
pitch.Enabled = false
end
end)
Hello there.
I checked your code and I found issue. Issue is that you said pitch.Enabled which is not how you play sound. To play sound you need to use [sound]:Play
I remade code and its almost same. It works for me
local pitch = workspace.Sound.ReverbSoundEffect
ac = false --- Prevents multiple sounds playing at same time
script.Parent.Touched:Connect(function()
if ac == false then ---- Checks if sound is already playing
ac = true
pitch:Play()
wait(1) --- Waits until sound ends (Change this to daturation of your sound)
pitch:Stop()
ac = false
else
end
end)
Just put the sound in a Transparent, CanCollide false Part the size of the room. You can change the RollOffMin and RollOffMaxDistances to the size of the Part so you can only hear it while you’re in the Part.
Sound used to come from the center of the Part, but now the outside surface is where it begins as per this announcement: Volumetric Sounds Public Release
EDIT: Do you mean that you have a global sound that you want to change the pitch of while your’e inside the building?
My method might work if you had the global sound playing all the time but played another sound while in the building so the combination would give the effect of the sound pitch change while they’re in the building.
It would be easier if you didn’t have to script anything.
Okay, so the sound is:
workspace.Sound
That should be a valid sound that you can select in workspace and click play and hear something, verify this is true.
Then the workspace.Sound.ReverbSoundEffect is something you can enable and disable, but the sound may have to be stopped and played again, im not sure if you can change effects on the fly.
you need a variable for the Sound in order to play it.
Is the sound playing on a loop when the game runs? Can you hear it? And you expect it to change and it isn’t? Explain what you hear and what you expect to hear and are not hearing.
I have a basic music system switching between many song id’s. What I want to happen is if you touch this block/wall the Reverb Sound effect will turn on. Right now nothing happens.