Hi, developers
I have a problem with that code:
local marketPlaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local functions = require(game.ReplicatedStorage.Functions)
local decOfCodesOfGamePasses = {["Self Heal"] = 10181459; ["Jump Boost"] = 10181368;}
local gearsOfGamePasses = game:GetService("ReplicatedStorage"):WaitForChild("Gears")["Gears
Of Game Passes"]
player.CharacterAdded:Connect(function()
for gamePass, code in ipairs(decOfCodesOfGamePasses)do
local success, message = pcall(function()
hasPass = marketPlaceService:UserOwnsGamePassAsync(player.UserId, code)
end)
if hasPass then
print("Player has the pass")
local tableOfGears = gearsOfGamePasses:GetChildren()
local gearOfGamepass = functions.GetObjectsValue(tableOfGears, gamePass):Clone()
gearOfGamepass.Parent = player.Backpack
else
print("Player doesn't has the pass")
end
end
end)
Another detail, am I putting it right?
EDIT: I tried a script instead local script, but that also didn’t work.