My game constantly disconnects, and I've narrowed it down to a spawning script?
04 | local c = game.Workspace.BlueMinionSpawns:GetChildren() |
07 | for index, child in pairs (c) do |
08 | if child.Name = = "BlueMinionSpawn" then |
09 | table.insert(spawns, child) |
16 | function pickRandomChild(tab) |
17 | return tab [ math.random( 1 , #tab) ] |
21 | local blueciviliancollection = game.Lighting.Troops.Blue.BlueCivilians:GetChildren() |
22 | local spawns = getSpawns() |
24 | local minion = pickRandomChild(blueciviliancollection):clone() |
25 | local spawn = pickRandomChild(spawns) |
27 | minion.Parent = game.Workspace |
29 | minion:MoveTo(spawn.Position) |
35 | local c = game.Workspace:GetChildren() |
37 | for index, child in pairs (c) do |
38 | if child.Name = = "BlueCivilian" or child.Name = = "BlueGirlCivilian" then |
39 | table.insert(minions, child) |
47 | if minionCount() < MAX_MINION then |
48 | if math.random( 1 , 2 ) = = 1 then |
I've been having disconnection problems ever since I've been working on my game
Civilization Domination
So I've been narrowing it down from the problem. I removed a couple of scripts, and tested for a hour each for each particular one. So then I found that when I removed a script that connected to multiple, it stopped disconnecting, so I narrowed it down to Troops, Spawning, or the Masterscript.
The Masterscript simply just loads buildings and messages onto the game, and I've been using the same one for quite a while.
The troops are relatively basic models that I've been working with for a good amount of time.
The spawning was a relatively new one.. I don't see anything wrong with it, but I find that if I removed it, the game would simply stop disconnecting(Though that carries back to whether the troops are the problem or not, but I've tested it with 30 troops all in the same time.)
Does anyone have any ideas?