I have a boombox/radio gamepass in my game, when I join my game and look in the console I am getting an error. The boombox gamepass and everything works I just would like no errors because it doesn’t look good.
The Error:
The Script:
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
function Spawned(player)
local HasGamepass = false
local success, message = pcall(function()
HasGamepass = MarketplaceService:UserOwnsGamePassAsync(player.userId, 27258381)
end)
if not success then
warn("Checking In Player Has Gamepass" .. tostring(message))
return
end
if HasGamepass == true then
game.ServerStorage.BoomBox:Clone().Parent = player.Backpack
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
Spawned(player)
end)
end)
Players.PlayerSpawned:Connect(Spawned)