I tried doing this on my script no output errors
local id = 4594022 game.Players.PlayerAdded:connect(function(player) if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, id) then script.Parent.Script.Disabled = false end end)
That script wouldn't work because of the way you're checking for passes. I suggest using this instead and looking at Abilities and Bonuses for more information.
local id = 4594022 game:GetService("Players").PlayerAdded:Connect(function(Player) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, id) then script.Parent.Script.Disabled = false -- This would not work if the global script is in the Gui and FilteringEnabled is set to true. end end)
Another thing, is the game FilteringEnabled? If it is this would not work because global scripts do not work in Guis when it is enabled. I suggest using a RemoteEvent instead.