War Posted April 21, 2022 Share Posted April 21, 2022 When I try to get the list of all player's inventory items it is always empty. If I call itemContainer:AddItem("Katana"); for player then the list contains 1 item. But what about already placed items in inventory? How to get them? Example code: local function Test() local players = getOnlinePlayers(); if players then for i=0,players:size()-1 do local player = players:get(i); print(player:getUsername()); local itemContainer = player:getInventory(); local inventoryItems = itemContainer:getItems(); if inventoryItems then print(inventoryItems:size()); -- always 0 before I add some katanas end end end end Any suggestions? What am I doing wrong? Thank you! Link to comment Share on other sites More sharing options...
BenPlem Posted August 31, 2022 Share Posted August 31, 2022 Hey! Did you find an answer to this? Cheers Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now