Search found 2 matches

by Data
Thu Dec 19, 2024 4:02 pm
Forum: Modding help
Topic: How to access inventory of a disconnected/editor player?
Replies: 3
Views: 249

Re: How to access inventory of a disconnected/editor player?

Pi-C wrote: Thu Dec 19, 2024 8:28 am I'd say you can't, you have to work around it. The events on_pre_player_left_game/on_player_joined_game and on_pre_player_toggled_map_editor are your friends …
Well, that's just disappointing.
Thanks for the clever workaround, might try to apply it
by Data
Thu Dec 19, 2024 7:05 am
Forum: Modding help
Topic: How to access inventory of a disconnected/editor player?
Replies: 3
Views: 249

How to access inventory of a disconnected/editor player?

Currently the way to access inventory of a connected player is (ignoring nil checks):
-- we access inventory on the character, not the player since player has no inventory while being in remote view
if player.character then
-- player is alive
local inventory = player.character.get_main_inventory ...

Go to advanced search