Hello, I have a script here and what it does it move a bar up to let a player out. Theres multiple bars though. I was trying to make it play a sound once the Bar has reached its destination, but all it seems to be doing is playing the sound everytime the for loop is run which makes it come out as a constant static. Here is my script.
Sounds = game.Workspace.Sounds
Bars = game.Workspace.Bars:GetChildren("Bar")
for i,Bars in pairs(Bars) do
for v = 0, 1.5, 0.1 do
Bars.Position = Bars.Position + Vector3.new(0,v,0)
wait()
Sounds.Clang:Play()
end
end
How to know when the Bar reached its destination?

2 comments
This is because the sound is within the loop that moves the bar. It seems that each bar will move up sequentially after the one before it so I'd assume you would want the sound to instead be played in the first loop.
You should have made that an answer so I could give you reputation because it worked thank you!