I have a crafting system, and when a player clicks an item, it goes through the player’s backpack, and destroys the item if item.Name == RequiredItem.Name. However, it gets very laggy to do this when the player has 3000+ items in their backpack (each piece of wood that the player gets is a tool in the player’s backpack). How could I make it less laggy?
1 Like
This would require lots of scripting, but you could use the number of the tools they have and turn it into one tool that deletes when it reaches 0
That would be a good idea, but unfortunately I would have to change the entire game’s code as everything is dependant on that
Couldn’t you just do WaitForChild(RequiredItem.Name) ?
Better FindFirstChild(Children.Name)
No it’s not, because it would wait instead of instantly giving you an error.
it will give error only if child not exist, so he need use
if Backpack:FindFirstChild(requirement) then
This won’t error/yield as much as WaitForChild.