Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how would one make a music play at a certain time?

i made a lightning strike and im trying to learn how to make thunder a few seconds before? ( like 4.5 seconds or so ) please help ive looked online and in forums

1 comment

0

you hear thunder after a lightning strike. I am not sure why you would the thunder to sound before...

2 answers

✓ Accepted answer

previously I made this script for you in your other question, first off all all you need to do now...... is add music right?

local Thunder = Instance.new("Sound",workspace)
Thunder.SoundId="something random"      --paste the sound, what ever you want...
Thunder.Looped = false
local a = 0
repeat
wait(.1)
script.Parent.Transparency = 1     -- so right now, you can't see the lightning
wait(4.5)
script.Parent.Transparency = 0 
Thunder:Play()    -- remember that after .5 secs the lightning will disappear and the thunder may still play

wait(.5)        -- i changed that so the lightning actually lasts longer
script.Parent.Transparency = 1 -- finally after .5 seconds of lightning, the lightning disappears
a = a + 1
print(a)
until a == 20

Thanks for using, Accept answer....

local Audio = Instance.new("Sound", game.Workspace) -- Creates a Sound in the Workspace
Audio.Name = "Thunder" -- Name of the Audio
Audio.Volume = 1 -- Audio's Volume; I don't recommend going past 3
Audio.SoundId = "rbxassetid://___" -- Replace the underscores with your audio ID
Audio.Looped = false -- Makes sure the Audio doesn't Loop
Audio.EmitterSize = 10 -- Mess around with this until desired effect
Audio:Play() -- Plays the Audio
wait(4.5) -- Waits 4.5 seconds
LightningStrike() -- Replace this with your Lightning Code

1 comment

2

Also, this is very basic. I recommend learning a bit more before asking stuff like this. Just a thought.

This discussion is preserved as it was. New answers, comments, and votes are closed.