The only problem is that the sound doesn't change at all.
local function onPlayerEntered(newPlayer)
local stats = Instance.new("StringValue")
stats.Name = "Area"
stats.Value = "Spawn"
stats.Parent = newPlayer
end
function onPlayerRespawned(newPlayer)
local stats = newPlayer:FindFirstChild("Area")
if stats == nil then
local stat = Instance.new("StringValue")
stat.Name = "Area"
stat.Value = "Spawn"
stat.Parent = newPlayer
end
local song1 = newPlayer.PlayerGui:FindFirstChild("Lobby")
if song1 == nil then
local song1 = Instance.new("Sound", newPlayer.PlayerGui)
song1.Looped = true
song1.Name = "Lobby"
local Id = "rbxassetid://"
song1.SoundId = Id.."319731744"
song1.Volume = .5
song1:Play()
elseif song1 ~= nil then
song1.Looped = true
local Id = "rbxassetid://"
song1.SoundId = Id.."319731744"
song1.Volume = .5
song1:Play()
local song2 = newPlayer.PlayerGui:FindFirstChild("Hi")
if song2 == nil then
local song2 = Instance.new("Sound", newPlayer.PlayerGui)
song2.Name = "Hi"
song2.Looped = true
local Id = "rbxassetid://"
song2.SoundId = Id.."319731744"
song2.Volume = .5
elseif song2 ~= nil then
song2.Looped = true
local Id = "rbxassetid://"
song2.SoundId = Id.."319731744"
song2.Volume = .5
song2:Play()
end
end
local stat = newPlayer:FindFirstChild("Area")
local song = newPlayer.PlayerGui:FindFirstChild("Lobby") or newPlayer.PlayerGui:WaitForChild("Lobby")
local songtwo = newPlayer.PlayerGui:FindFirstChild("Hi") newPlayer.PlayerGui:WaitForChild("Hi")
if stat == nil then
local k = Instance.new("StringValue",newPlayer)
k.Name = "Area"
else
stat.Value = "Lobby"
songtwo:Stop()
song:Play()
if stat == nil then
local k = Instance.new("StringValue",newPlayer)
k.Name = "Area"
else
stat.Value = "Hi"
songtwo:Play()
song:Stop()
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end
game.Players.ChildAdded:connect(onPlayerEntered)

2 comments
Hey you used my script. Nice!!
It seemed to be a bit more organized and missing some stuff, however it still didn't work 100%