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

How Can I Have Different Music In Different Rooms?

Asked by 9 years ago

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

Log in to vote
5
Answered by 9 years ago

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!

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. Vezious 310 — 9y
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? ScriptFusion 210 — 9y
0
You should accept his answer, he has basically done the hard work for you, if you don't use filtering enabled xuefei123 214 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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

Answer this question