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

How Can I Have Different Music In Different Rooms?

I am new to scripting and editing GUIs and I am trying to learn more about sounds, I would really appreciate it if you answered

2 answers

✓ Accepted answer

Make a part in the entrance to the room with a script in it, that clones the music into the Player's PlayerGui. You need to use :GetPlayerFromCharacter(), eg.

script.Parent.Touched:connect(function(p)
local music = --whatever:Clone()
if p.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(p.Parent)
if player then
if player.PlayerGui.Music then
print("Music all ready")
elseif player.PlayerGui.Music == nil then
music.Parent = player.PlayerGui
music.Name = "Music"
music:Play()
end
end
end
end)

If this helps, accept the answer. It gives us both rep!

3 comments

0

In Mad games, in the VIP room, the sound is in a part, and when you exit the door it stops playing for you. Idk how he does it. Since the sound isn't in the client. Just saying.

1

Loleris uses filtering enabled so it is easier, but you do not want filtering enabled if you have just started, just use my method, and could you accept my answer?

0

You should accept his answer, he has basically done the hard work for you, if you don't use filtering enabled

You would probably have to put the music in the LocalPlayer is my guess

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