Tools Not Loading To Player Inventory

You can write your topic however you want, but you need to answer these questions:

  1. 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.

  1. 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.

  1. 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!

1 Like

Did you try to enable the Studio API Services?
You can use CharacterAdded event and add a small delay to ensure everything is ready.
Also, try using “pcall” to see if you can catch any errors.
Or try loading the tool after the player and components are added to the game
You also mentioned that you can’t use StarterPack directly, you can still use it with custom logic to load tools based on saved data.

Potential Solutions:

Switch to CharacterAdded Event

Tip: If your using GetAsync to retrieve data, ensure that the data is fully loaded before proceeding.

1 Like

I had done everything suggested here except for adding a characterAdded layer and that yield seems like it works! Thank you very much for confirming my suspicion and pointing me in the right direction!

I am definitely going to take a break now as I can rest well knowing people’s items wont randomly be vanishing. Thanks again, and best wishes going forward!

1 Like

Glade! I was able to help you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.