I have ran into a tricky situation. I am using :IsA() to find anything with the Tool ClassName inside a folder, which is due to multiple tools inside the folder. I do not know what is causing the error.
Output:
15:27:55.917 - ServerScriptService.MainGameScript:290: attempt to call method 'IsA' (a nil value)
15:27:55.918 - Stack Begin
15:27:55.918 - Script 'ServerScriptService.MainGameScript', Line 290
15:27:55.918 - Stack End
Code:
CBBToolsFolder = MinigameTools.ClassicBrickbattle CBBTools = CBBToolsFolder:GetChildren() if CBBTools:IsA("Tool") and CurrentMap.MapName.Value == "Classic Brickbattle" then for i = 1, #Player do CBBTools:Clone().Parent = Player[i].Backpack end end
You can't call :IsA() on a table. Here's a fixed code:
CBBToolsFolder = MinigameTools.ClassicBrickbattle CBBTools = CBBToolsFolder:GetChildren() for i, v in pairs(game:GetService("Players"):GetPlayers()) do for x, y in pairs(CBBTools) do if y:IsA("Tool") and CurrentMap.MapName.Value == "Classic Brickbattle" then y:clone().Parent = v.Backpack end end end
If this helped, please accept!