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

How to imput intro music into my game?

Asked by 8 years ago

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.

0
Scripting helpers is NOT a reqest site. We can't help you without an attempt. ChemicalHex 979 — 8y
0
I'm not requesting it. I want to know how to do it. RubyQube 10 — 8y

3 answers

Log in to vote
0
Answered by 8 years ago

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()

0
Wait, so I put the script.Parent:Play() where? Sorry i'm new to scripting. RubyQube 10 — 8y
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. UnityAlex 36 — 8y
0
Could you tell me why it won't stop after 5 seconds? Thanks. RubyQube 10 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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

0
game.Players.ChildAdded:connect(PlayerAdded) SurvivalAptissimum 25 — 8y
Log in to vote
0
Answered by 8 years ago
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

Answer this question