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

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

Asked by 7 years ago

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

0
you hear thunder after a lightning strike. I am not sure why you would the thunder to sound before... bigboy77584 19 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

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....

Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago
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
2
Also, this is very basic. I recommend learning a bit more before asking stuff like this. Just a thought. animelover6446 41 — 7y

Answer this question