Edit: I seemed to have solved the bug by adding a second condition in the if-statement that checks if the user owns the gamepass. It now looks like this:

if mp:UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId, 13467250) or game.Players.LocalPlayer.Name == "Player1" then

I'm not sure if this is some vulnerability issue roblox should check out or if it was just some strange bug.


I made this script for a donation gamepass, where if you bought the pass you'd be able to play some songs within my game. The songs are stored within the user's PlayerGui, and if you own the gamepass you'd go into settings and click a button which clones the songs into workspace and plays them in a loop. However, it seems the the songs play for other users in the server too. I'm not sure how that'd be happening (because of FE), but I was wondering if anyone knew a solution or alternate method I could use.

This is my localscript stored within the button you click to enable/ disable the music:

mp = game:GetService("MarketplaceService")
started = false

script.Parent.MouseButton1Click:Connect(function()
	if mp:UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId, 13467250) then
		if script.Parent.Text == "Enable Bonus Music" then
			script.Parent.Text = "Disable Bonus Music"
		
			if not started then started = true
				local g1 = script.Parent.Gothic1:Clone()
				local g2 = script.Parent.Gothic2:Clone()
				
				g1.Parent = workspace.Music
				g2.Parent = workspace.Music
				
				spawn(function()
					while true do
						wait(1)
						workspace.Music.Gothic1:Play()
						wait(218)
						workspace.Music.Gothic2:Play()
						wait(290)
					end
				end)
			end
			
			workspace.Music.Gothic1.Volume = 0.2
			workspace.Music.Gothic2.Volume = 0.2
		else
			script.Parent.Text = "Enable Bonus Music"
			if started then
				workspace.Music.Gothic1.Volume = 0
				workspace.Music.Gothic2.Volume = 0
			end
		end
	else
		mp:PromptGamePassPurchase(game.Players.LocalPlayer, 13467250)
	end
end)

-- this bit is for another event in the game
-- which would stop playing the music if
-- it happened to be enabled for a player
game.ReplicatedStorage.Events.BonusMusicVictory.OnClientEvent:Connect(function()
	if started then
		script.Parent.Text = "Enable Bonus Music"
		workspace.Music.Gothic1.Volume = 0
		workspace.Music.Gothic2.Volume = 0
	end
end)

I did seem to receive a warning in the console I'd never seen before which might have to do with this problem. It says "Error filtering message: it's supposed to be local for gamepass owners HTTP post exception: HTTP 500 (Internal server error)

(Also, it seems when I test it in roblox studio, and I press the button to spawn the sounds on my client, it doesn't get replicated to the server. But in Roblox itself, other players can hear the music, even if the sounds aren't on their client/ the server somehow.)

Thanks in advance!