So I was making the tools save when a player leaves the game, the datastore got a bit messed up but it is fixed now. The problem is, many players had duplicated tools in their backpack and is a bit of annoying to sort them everytime rejoining.
So, I created several scripts that when the player has a same tool in their backpack, destroy all of them and only leave ONE of each tool.
Unfortunately, none of them worked.
My script is a script that detects (find child) and fire the server to destroy the tool. But it just doesn’t work. Any help is appreciated!
You can fix this problem by sorting out the way the players are getting the tools, basically as you said you are using datastores, you can add this to your datastore script where you are adding tools and it should be fine
if not player.Backpack:FindFirstChild(ToolName) then
--add your tool here
end
you should also add this to your other toolgiver scripts to make sure there are no duplicated tool in a players backpack. If you maintain this, everything should be alright, let me know if you want further help.
thanks, this will prevent having duplicated tools.