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

how do i add different sounds to a game?

Asked by 7 years ago

for example, i wanna add this icy side to my game, and this firey side to my game, but i want it to where once you step from the icy side to the fire side (or vice versa) it plays a different song

0
You would Use Filtering Enabled. You would prety much just play the sound on the client side so that one "that" on person can hear the music. FiredDusk 1466 — 7y
0
so that one person* FiredDusk 1466 — 7y

1 answer

Log in to vote
-1
Answered by
xVanc -1
7 years ago

You could use these two scripts BTW, you will want to make an invisible part around that area you want the music/sound you want it to be in, (Ex. Icy Area)

This script activates when a player touches the invisible part, in this case the player enters the certain area.

Also, add the sounds you want in the startergui.

That's the player entered music script.

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then   
    game.Players[hit.Parent.Name].PlayerGui.Sound1.Volume = 1
    game.Players[hit.Parent.Name].PlayerGui.Sound1:Play() -- Sound1 = the sound 
    print('PlayerHasEntered')
    script.Disabled = true
    script.Parent.Off.Disabled = false
    end
end)

Next is the player exited music script

script.Parent.TouchEnded:Connect(function(hit)
    if hit.Parent:FindFirstChild('Humanoid') then   
    game.Players[hit.Parent.Name].PlayerGui.Sound1.Volume = 0 -- This will silent the music.
    print('PlayerHasExited')
    script.Disabled = true
    script.Parent.On.Disabled = false
    end
end)

Try this.

0
wow, thank you for the help! you're a real life saver :D starlord13789 0 — 7y
0
also, what is a startergui? (I'm a relatively new roblox studio-er, but i have 3D modeled on MANY occasions before so i do know quite a bit of things about 3D modeling) starlord13789 0 — 7y
0
oh, no problem also, look up top, then go to 'View>Explorer>(Inside Explorer look down and you'll see startergui) xVanc -1 — 7y
0
if you're new to studio probably go on youtube and search "Roblox Studio: Basics" xVanc -1 — 7y
View all comments (2 more)
0
thanks! i did! starlord13789 0 — 7y
0
upvote? pls xVanc -1 — 7y
Ad

Answer this question