brian_poon
New member
- Joined
- Aug 12, 2021
- Messages
- 1
- Reaction score
- 0
How to code "save inventory" and "load inventory" with free.I do not want to buy Nobles.
KEEP IN MIND this is not a good alternative for those with a rank. This takes up saved var space, which save inventory does not.On leave, append list with the hotbar, inventory and armor game values then append value offhand item.
On join, repeat for each in list and increase the index (a number to keep track of the position) by 1, then use SetSlotItem to set the item at that index to the loop item.
View attachment 905
generally explaining code to a new player like this isn't a good idea. some people would find it "confronting".Player Event [Join] {
Player Action [Give Item] { (%default Inv) }
Player Action [Set Armor Items] { (%default Armor) }
Player Action [Set Equipment (OffHand) ] { (%default Offhand) }
}
Player Event [Leave] {
Set Variable [=] { (%default Inv) (Game Value [Item Values - Inventory items]) }
Set Variable [=] { (%default OffHand) (Game Value [Item Values - OffHand item]) }
Set Variable [=] { (%default Armor) (Game Value [Item Values - Armor items]) }
}
All variables should be SAVE
keep in mind that any plot will take up var space and this is not going to matter for most plotsKEEP IN MIND this is not a good alternative for those with a rank. This takes up saved var space, which save inventory does not.
Yes, but items take up a large amount, and it is optimal to avoid when you have a rank. There is no reason not to use save/load inventorykeep in mind that any plot will take up var space and this is not going to matter for most plots
isnt save/load inventory incredibly glitchy and slowThere is no reason not to use save/load inventory
yesisnt save/load inventory incredibly glitchy and slow
I'm confused, could you send a screenshot of the block code? It seems to duplicate items weirdly.On leave, append list with the hotbar, inventory and armor game values then append value offhand item.
On join, repeat for each in list and increase the index (a number to keep track of the position) by 1, then use SetSlotItem to set the item at that index to the loop item.
View attachment 905
it's because of the Hotbar Items game value, remove it and it should work since the Inventory Items game value already has the hotbar items.I'm confused, could you send a screenshot of the block code? It seems to duplicate items weirdly.