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

How to imput intro music into my game?

Hello. Just a quick question, I want to put intro music into my game. Every time a player joins they here this music for about 5 seconds. Every second it will get more faint. When the 5 seconds is up it will just shut off. Does anyone know how to do this?

Thanks.

2 comments

0

Scripting helpers is NOT a reqest site. We can't help you without an attempt.

0

I'm not requesting it. I want to know how to do it.

3 answers

✓ Accepted answer

Put this script in the sound, and the sound in StarterGui.

script.Parent:Play()
wait(1)
script.Parent.Volume = 0.4
wait(1)
script.Parent.Volume = 0.3
wait(1)
script.Parent.Volume = 0.2
wait(1)
script.Parent.Volume = 0.1
wait(1)
script.Parent:Destroy()

3 comments

0

Wait, so I put the script.Parent:Play() where? Sorry i'm new to scripting.

0

Right click in explorer. Click insert-->sound. Put it in StarterGui. insert-->script. Copy this code into the script. Put the script in the sound.

0

Could you tell me why it won't stop after 5 seconds? Thanks.

Use onPlayerJoined(), the answer that he put would restart the sound everytime you die.

1 comment

0

game.Players.ChildAdded:connect(PlayerAdded)

game.Players.ChildAdded:connect(function(Player) --Using ChildAdded for use in Solo mode
	if Player:IsA("Player") then
		local SoundFile = script:FindFirstChild("Sound"):clone()
		SoundFile.Parent = Player:WaitForChild("PlayerGui")
		SoundFile:Play()
		for i=1,20 do
			SoundFile.Volume = SoundFile.Volume -0.025
			wait(0.25)
		end
		SoundFile:Stop()
		SoundFile:Destroy()
	end
end)

That should work

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