Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Does anyone know how to make a script which will play a sound every 20 seconds?

Asked by 4 years ago

For my horror game, i want to add sound effects to my game to make it more scary but i need help with a script

The sound effect i want to use is:

https://web.roblox.com/library/2139510606/Monster-Roar-Sound-Effect

And I want it to play every 20 seconds

Any help? Anything will be helpful :)

0
This is not a request site, a helping site. maxpax2009 340 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

In order to do it, you need to know what is a while loop - So basically a while loop is a loop that goes on forever until you break the loop

local Sound = Instance.new("Sound") -- We will create a new sound using Instance new
Sound.SoundId = "rbxassetid://2139510606" -- we will set the id of the sound to that
Sound.Parent = script.Parent -- You need to set the parent of the Sound, if not it won't work
while wait(20) do -- so basically the script will wait for 20 seconds then do whatever we told it to do
Sound:Play() -- we will play the sound
end
0
Btw, this is not a request site so try to do it your self next time and if you have any error then ask it here Nguyenlegiahung 1091 — 4y
0
I understand Spo_tted 15 — 4y
Ad

Answer this question