You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to save a tool to the players inventory when they leave the game, and load that tool when they rejoin into their backpack.
- What is the issue? Include screenshots / videos if possible!
I already have a system for this, and it seems to save just fine. The issue is that it will often not load, but this issue is exclusive to the roblox player, and everything works fine in studio.
Also I know specifically that it isn’t loading and that it is saving fine because I played in the roblox player then loaded my save in roblox player, no pickaxes in inventory, then loaded my save in studio, and I had my pickaxes back.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried reorganizing a lot of stuff, I have combed through most of my save and load programs and I really believe there is something I am either completely missing regarding yielding or its a really weird technical issue with bindable functions on startup.
I have tried print statements and I have tried waiting before invoking load, currently it is invoked when the playeradded event fires, I am wondering if I should switch that to player character, not sure if that would help at all.
I cannot use starterpack because of the way my game works, unless there is some cool way to use starter pack individually for each player based on saved data, and if that happens to fix the issue I can convert to that. Path of least resistance is ideal though.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
I will post the save and load scripts here (removed since solution given). My suspicion is that I am not yielding for something crucial to the load script and that studio is just somehow faster than player so it compensates for whatever loading issue I am having in player.
Also note, the part of the scripts that save the CFrame matrix of the tool and load that tool in workspace work perfectly fine, the issue lies soulely with the tool being loaded into the players inventory. This has basically a 90% chance of happening in the roblox player, and a 1% chance of happening in studio, again not sure why but guessing I am not correctly waiting for something.
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Thank you sincerely for the help!