I’m working with for loops in arrays and i’m getting this error:
Unable to cast Array to int64 - Server - gamepasses:20
this is my code:
local MarketPlaceService = game:GetService("MarketplaceService")
function values(t)
local i = 0
return function() i = i + 1; return t[i] end
end
local items = {
{26875613, {script.Bomb5}},
{26876499, {script.RPG5}},
{26875573, {script.Bomb5, script.RPG5}},
}
for item in values(items) do
local gamepassId = items[1]
local tools = items[2]
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Wait()
if MarketPlaceService:UserOwnsGamePassAsync(plr.UserId, gamepassId) then
for tool in values(tools) do
local ToolClone = tool:Clone()
ToolClone.Parent = plr.Backpack
end
end
end)
end