BoomBox Gamepass Error

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)

On line 29, the event PlayerSpawned is not a valid event.

Did you mean “PlayerAdded”?

You can also just delete that line, because the rest of the code looks perfectly fine. That last line is unnecessary.

2 Likes