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

Sound help, please?

What I want is when you join the game they have this song playing and the song is 81 seconds btw.. Then it plays a diff song.

while true do
script.Parent:Play()
wait(84)
script.Parent.SoundID = "268518248" :Play()
end

2 answers

✓ Accepted answer

They way we will detect a player added, is when a player is added to game.Players. Hope This Helps Code:

local sound = script.Parent

function onPlayerEntered(player)
	repeat wait () until player.Character
	sound:Play()
	wait(84)
	sound.Soundid = "http://www.roblox.com/asset/?id=222954131"
end

game.Players.PlayerAdded:connect(onPlayerEntered)

4 comments

0

Nope, does not work

0

do you get any errors?

0

You try it out for yourself

0

Ok i edited to code a bit, so it waits for the character to fully load

music = Instance.new("Sound",workspace)
music:Play()
music.SoundId = "SOUND ID HERE"
--Also if u want to add a nother sound do elseif music.IsPlaying == false then music.SoundId = ""
--[[  YOURE WELCOME FRIEND :)  ]]--
while true do
	wait(10)
if music.IsPlaying == false then
	music.SoundId = "SOUND ID HERE"
elseif music.IsPlaying == false then
	music.SoundId = "DIFF SOUND ID HERE"
end
end


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