I’m trying to add items stored in replicated storage then subtracting the currency amount from the players leaderstats. This was somewhat successful however I’m struggling to clone the items into the players backpack. I’m also getting a weird message I’ve never seen before. I haven’t tried much because this is all new to me.
This is part of a server script inside a folder in the workspace. It sees which button was clicked and gets the values in the button to change the leaderstats value and see the item name. Any help is appreciated!
The DataStore request warning is because a script in your game is sending too many DataStore requests. If you get this warning and more requests are still sending, the DataStore will soon stop working and give you an error. Try to limit those to a smaller amount so players don’t lose their data.
Which part of the code are you struggling with regarding cloning tools to a player’s backpack? Is it cloning the items to the backpack at all, or the way you’ve written it, or something else?
For the warning message, I honestly feel like you’re calling a DataStore method every time data changes. I wouldn’t know, because there’s no code related to the warning message that’s being spat out. In what cases do you make write requests to your DataStore (SetIncrementUpdateRemoveAsync)? You can use the code search tool to acquire this information.
All I’m doing is changing the currency value every time they purchase an item with a button. I’ll make it eventually not allow them to buy it if they already purchased it or something. The code I’m struggling with is cloning the item to the players backpack. I’m not getting any errors on that part where it sets the parent to the Backpack.