I would like to have explosions for my WW2 game go off around the players around every 15-20 seconds and I want it to loop would anyone have an idea to make this?
Would you want the explosions from a GUI perspective or workspace perspective?
I suggest you start by using a while true do
loop with a wait()
and from there you can design some kind of explosion. Make it randomly position around (SetPrimaryPartCFrame or MoveTo) the player by cloning that object/GUI into its proper place with a random table of positions which you can create. Play around with it and see where it gets you. After you are happy with those random positions, you can maybe search up on Youtube how to make an explosion.
I want it to be in a part that will activate randomly after certain amount of seconds
Just use the while true function.
Example:
local Sound = script.Parent.Sound
while true do
wait(the time the time should play after sound)
Sound:Play()
end
So here’s basically what you would do.
local SoundFolder = where.your.folder.is:GetChildren()
local Debris = game:GetService("Debris")
local RNG = random.new()
while wait(RNG:NextNumber(15, 20) do
local Sound = SoundFolder[math.random(1,#SoundFolder)]:Clone()
Sound.Parent = workspace
Sound:Play()
Debris:AddItem(Sound, Sound.TimeLength)
end
Wrote this in the devforum comment section thingy so i haven’t checked for typos, Hopefully this works as you want it to!
For you saying you want to active it at a part randomly, You’d have to change the sound code a bit to work with the parts