I made a game, the gamepasses show up when the server is relatively empty, but after that they do not. I have it set up so it checks to see if the player owns the gamepass, and then copies the model from Lighting to put it in the player's inventory.
Script:
game.Players.PlayerAdded:connect(function(player) while true do if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId, 4988705) then if player.Backpack:FindFirstChild("Broomstick") == nil and player.Character:FindFirstChild("Broomstick") == nil then print(player.Name .. " got an item!") local b = game.Lighting:FindFirstChild("Broomstick"):Clone() b.Parent = player.Backpack end end wait(1)
end end)
Broomstick is the name of the tool in Lighting that is being cloned. Why is this unreliable?

8 comments
Please use serverstorage
Use serverstorage for what? The tools?
Can you put your code in a code block
Don't use lighting as a storage, use ServerStorage for the tools, or anything honestly.
Seems kinda excessive that you have an endless loop running for each player that joins constantly checking if they own the pass and all, I would change it to CharacterAdded or a button
Try this: game:GetService("MarketplaceService"):PlayerOwnsAsset(player.userId, 4988705)
@ above I believe UserOwnsGamepassAsync is a better way of doing it
yes and userId is deprecated