I am trying to load gamepasses from a players inventory it works on my main but not on my alt nor my friends account and all accounts have inventory open to public
The Module I Use
Server Script
local function LoadPasses(player)
local playerPasses = GamepassesModule.GetGamePasses(player.UserId)
for i, v in ipairs(playerPasses) do
Remotes.LoadGamepasses:FireClient(player, v.Id)
end
end
Local Script
local FormatNumberAlt = require(game.ReplicatedStorage.Libs:WaitForChild("FormatNumberAlt"))
local module = require(game.ReplicatedStorage.Libs:WaitForChild("DonationModule"))
local MousePlus = require(game.ReplicatedStorage.Libs:WaitForChild("Mouse+"))
--[[Services]]--
local MarketPlaceService = game:GetService("MarketplaceService")
local RunService = game["Run Service"]
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
local Template = script.Parent.Template
Template.Visible = false
script.Parent.Parent.HoverTemplate.Visible = false
function new(passid)
local ProductInfo = MarketPlaceService:GetProductInfo(passid, Enum.InfoType.GamePass)
local newGamePass = Template:Clone()
newGamePass.Visible = true
newGamePass.Parent = script.Parent
local MouseEnter, MouseLeave = MousePlus.MouseEnterLeaveEvent(newGamePass)
local Hover = script.Parent.Parent.HoverTemplate
local connection
MouseEnter:Connect(function()
Hover.Visible = true
Hover.NameOfGamepass.Text = ProductInfo.Name
Hover.PriceOfGamepass.Text = "R$ "..FormatNumberAlt.FormatCompact(ProductInfo.PriceInRobux)
connection = RunService.RenderStepped:Connect(function()
Hover.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
end)
end)
MouseLeave:Connect(function()
Hover.Visible = false
connection:Disconnect()
end)
newGamePass:WaitForChild("IconOfGamepass").Image = "rbxassetid://"..ProductInfo.IconImageAssetId
return newGamePass
end
local remotes = game.ReplicatedStorage.Remotes
remotes.LoadGamepasses.OnClientEvent:Connect(function(passid)
new(passid)
end)