Saving tools data with DataStore2

Also, i am getting data, because the script is actually saving any alteration that i do. If the player gets a new tool on his backpack, leave the game, and then come back, the tool will be there. If the tool is removed, when he rejoin, it wont be there anymore. All of that works fine, except when we talk about the last tool.

I have found a solution for this problem. After making a few tests, i have figured that i had to check at the adjust function if both the backpack and the character had a tool, and if there is no tool, then save the data. I am messing around with DataStore2 for the purpose of testing, but i am still not sure if i will actually implement it in a game, because of some concerns Concerns about Berezaa's datastore saving method - #25 by berezaa that have been raised about this method. Anyways, thanks for all the help!

2 Likes

Hello. Can you define an equipped tool drop event to update the data in the DataStore2?