Hello. I am currently making a countdown sequence. I have tried making a When ...i = true then game.ReplicatedStorage.Sounds.Tick Sound:Play end)
I have made this system.
--Sound plays when the thing is true
game.StarterGui.CountdownGui.Statement. ...i..i
When statement = true do
game.ReplicatedStorage.SoundFolder.Tick:Play)
end)
This is getting difficult every single second because I am still struggling with sound:play and some value statements.
As HugeCoolboy2007 said, you should probably improve your code. If this is what you actually have in your script, there are many errors that you need to fix, I will make your life easier and do it for you.
game.StarterGui.CountdownStatement. ...i..i --What is that supposed to mean?
while statement do
game.ReplicatedStorage.SoundFolder.Tick:Play()
end
Ok, let’s review this line-by-line. First off, what is ...i..i supposed to mean? Can you include context so that we know how the variables will behave? Next, I cleaned up the while loop a bit. However, make sure to use a wait(n) when running a loop to prevent execution timeout. If you are going to have it tick every second, use wait(1) and for every ten seconds use wait(10), etc. But furthermore, the main issue with your code is that you are trying to play an audio out of ReplicatedStorage. Sounds should be a parent of something that the client actually sees, such as the workspace, a basepart, or the StarterGui. Move the audio to one of those and redo the directory, then clean up your code based on the suggestions of me and HugeCoolboy2007. If it still doesn’t work, just let me know.
I am like trying to make a ticking clock thing. Like a …i… statement would technically play a sound each second, I have tried sound:play thongs next to the countdowns, but its still a struggle.
Ok. But are you aware that your loop is executing every second? The method used to play the audio may not be the problem and it may be the code that you have used. Make sure to check that the loop is running by adding a print("Ran.") to replace the playing method. If your output does not write Ran. every second, then you need to fix your loop. You can replace the whole loop with this if it does not work.