You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? I would like it so when a person owns a gamepass, it gives them a keycard when they spawn and I don’t know what’s wrong with it.
What is the issue? It doesn’t trigger that the gamepass is in someone’s inventory.
What solutions have you tried so far? Yes. I have tried removing the CharacterAdded and much more.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Server:
local id = 10111638
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:Connect(function()
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId, id) then
game.Lighting["[SCP] Card-L3"]:Clone().Parent = player:WaitForChild("Backpack")
end
end)
end)
Try adding prints to debug the code and are there any errors in the output?
Try changing connect with capital C since connect is deprecated as well as userId with capital U.
I agree. The userId should be replaced with UserId, but connect does not need to be changed to Connect. It works fine for me with connect, aswell as Connect.