This gamepass script isn’t working. I have the correct id. Not sure why it isn’t working.
local MarketplaceService = game:GetService(“MarketplaceService”)
local Players = game:GetService(“Players”)local gamePassID = 10092241
function onPlayerSpawned(player)local hasPass = false local success, message = pcall(function() hasPass = MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID) end) if not success then warn("Error while checking if player has pass: " .. tostring(message)) return end if hasPass == true then
game.ServerStorage.GreenBalloon:clone().Parent = player.Backpack --replace “SuperFlyGoldBoombox” with your item
end
endgame.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
onPlayerSpawned(player)
end)
end)Players.PlayerAdded:Connect(onPlayerSpawned)