-
What do you want to achieve? I’m trying to get the player’s equipped items from the lobby inside of the game itself.
-
What is the issue? Whenever I attempt to grab the table including the player’s items from the lobby, it returns nil.
-
What solutions have you tried so far? I’ve changed variable names, made them local, searched on youtube, nothing worked so far.
Lobby Code:
local weapons = {}
for i,v in pairs(plrs) do
weapons[v.UserId] = PlayerInformation[v.UserId].EquippedItems
end
local options = Instance.new("TeleportOptions")
options:SetTeleportData({
["PlayerCount"] = #plrs,
["Weapons"] = weapons
})
Printing the “weapons” table in the lobby returns:
{
[168891080] = ▼ {
[1] = "Pistol",
[2] = "AK-47"
}
}
Problem is that, in my other game, I can’t seem to access the Weapons table.
local function plrAdded(plr)
local joinData = plr:GetJoinData()
local teleportData = joinData.TeleportData
if teleportData then
print(teleportData.Weapons) -- prints some weird "table: 0x093r39j" whatever in the console.
for i,v in pairs(teleportData.Weapons) do
print(i,v) -- prints "168891080 table: 23843200fwefws3e4" or something
end
end
If I attempt to access that table at all (teleportData.Weapons[plr.UserId]) it returns nil