Hello,
Recently, I’ve been working on a gamepass system that uses a dictionary to see if user owns a specific gamepass or not, and I received complaints about testers not receiving the gamepasses that they bought. I don’t know if my system has an issue or not.
Code:
local Gamepasses = {
{
Name = “AKM”,
ID = 14388127,
Directory = game.ServerStorage.PassStorage.AKM,
Cost = 450,
},
{
Name = “Access Pass”,
ID = 14404925,
Directory = game.ServerStorage.PassStorage.AccessPass,
Cost = 50,
},
{
Name = “RPG-7”,
ID = 14448110,
Directory = game.ServerStorage.PassStorage[“RPG-7”],
Cost = 1500,
},
local PassStorage = game.ServerStorage
local Marketplace = game:GetService(“MarketplaceService”)
game.Players.PlayerAdded:Connect(function(player)
for key, value in pairs(Gamepasses) do
if Marketplace:UserOwnsGamePassAsync(player.UserId, value.ID) then
PassStorage:FindFirstChild(value.Name):Clone().Parent = player.Backpack
PassStorage:FindFirstChild(value.Name):Clone().Parent = player.StarterGear
end
end
end)
Any feedback would be much appreciated!