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

How would I add a 2nd audio to this script Help?

I feel like it's a simple thing, i just don't know how Help?

local player = game.Players.LocalPlayer
local sound = Instance.new("Sound",player)

sound.SoundId = "rbxassetid://"..531211690
sound:Play()

1 answer

✓ Accepted answer

It is, very simple. All you would have to do is this:

Local Script - Place in StarterGui

local player = game.Players.LocalPlayer
local sound = Instance.new("Sound",player)

sound.SoundId = "rbxassetid://"..531211690 -- First
sound:Play() -- Plays the song.
wait(120) -- How long the song is.
sound:Destroy() -- Destroys the song.
sound.SoundId = "rbxassetid://"..531211690 -- Second
sound:Play() -- Plays the song.
wait(120) -- How long the song is.
sound:Destroy() -- Destroys the song.

UPDATE - Includes "sound.Ended:Wait()" from OldPalHappy

local player = game.Players.LocalPlayer
local sound = Instance.new("Sound",player)

sound.SoundId = "rbxassetid://"..531211690 -- First
sound:Play() -- Plays the song.
sound.Ended:Wait() -- Waits for the song to end.
sound:Destroy() -- Destroys the song.
sound.SoundId = "rbxassetid://"..531211690 -- Second
sound:Play() -- Plays the song.
sound.Ended:Wait() -- Waits for the song to end.
sound:Destroy() -- Destroys the song.

sound.Ended:Wait()

I recommend you look up very basic scripting tutorials on Youtube. Here is the link to their playlist. Hope this helps!

Accept this answer if this helps and don't forget to upvote!

3 comments

0

To wait for a song to end on the client, use sound.Ended:Wait().

0

Updated it, thanks for reminding me.

0

Thanks very much

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