📅  最后修改于: 2022-03-11 14:54:54.502000             🧑  作者: Mango
-- It's not bad code, I just think it could be JUST a bit more organised (if you wanted to add more than one check for gamepasses in the same script)
local id = -- your gamepass id here (look on tutorials on how to get it)
local marketService = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(user)
if marketService:UserOwnsGamepassAsync(user.UserId, id) then
-- code that's related to the gamepass.
end
end)