I'm making a loading screen but everyone can hear the music even those not on the loading screen what do I do?
local function playerAdded(player) wait(2) script.Parent.Text = "loading." script.Parent.Parent.TextButton.LocalScript.LoadingScreen.Playing = true wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Visible = false script.Parent.Parent.TextButton.Visible = true end game.Players.PlayerAdded:Connect(playerAdded) for _, player in pairs(game.Players:GetPlayers()) do playerAdded(player) end
Instead of making the loading screen invisible, destroy it so others cannot activate the audio.
This issue occurs because it is a regular script and not a localscript.
local function playerAdded(player) wait(2) script.Parent.Text = "loading." script.Parent.Parent.TextButton.LocalScript.LoadingScreen.Playing = true wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent.Text = "loading.." wait(.7) script.Parent.Text = "loading..." wait(.7) script.Parent.Text = "loading" wait(.7) script.Parent.Text = "loading." wait(.7) script.Parent:Destroy() end game.Players.PlayerAdded:Connect(playerAdded) for _, player in pairs(game.Players:GetPlayers()) do playerAdded(player) end
This should fix it.