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 8 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 — 8y
0
so that one person* FiredDusk 1466 — 8y

1 answer

Log in to vote
-1
Answered by
xVanc -1
8 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.

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

Next is the player exited music script

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

Try this.

0
wow, thank you for the help! you're a real life saver :D starlord13789 0 — 8y
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 — 8y
0
oh, no problem also, look up top, then go to 'View>Explorer>(Inside Explorer look down and you'll see startergui) xVanc -1 — 8y
0
if you're new to studio probably go on youtube and search "Roblox Studio: Basics" xVanc -1 — 8y
View all comments (2 more)
0
thanks! i did! starlord13789 0 — 8y
0
upvote? pls xVanc -1 — 8y
Ad

Answer this question