Weird For Loop Timeout Error (Possible Engine Bug?)
Before I ramble on about this, I asked around in the Scripting Helpers Discord, and I had a few people mention this might be a Engine bug as this should not be timing out. When I first scripted this about 2 weeks+ back, it worked 100% flawlessly, now that I come back to work on it, I'm getting this timeout error.
Anyways, about the script, It's a simple player join script. Under the join script I have all the values I need it to create, since I'm creating a form of a tech tree for my game, and a resources folder. Hard to explain, but this picture would better represent. You'd also need to see the image to somewhat understand the code. I know there's other ways to do this better, but I just want to do this my way, you know? Image
I'm not sure how to further explain this, so here's the code. It times out on line 90, which would be the second for loop.
01 | local leaderstats = Instance.new( "Folder" ) |
02 | leaderstats.Name = "leaderstats" |
03 | leaderstats.Parent = plr |
05 | local Cash = Instance.new( "IntValue" ) |
07 | Cash.Parent = leaderstats |
09 | local TechTree = Instance.new( "Folder" ) |
10 | TechTree.Name = "PlayerTechTree" |
13 | local Resources = Instance.new( "Folder" ) |
14 | Resources.Name = "PlayerResources" |
17 | for _,v in pairs (script.TechTree:GetChildren()) do |
22 | for _,v in pairs (script.Resources:GetChildren()) do |