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.
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()
Use onPlayerJoined(), the answer that he put would restart the sound everytime you die.
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