I’m making a function that saves a model for datastore2 but when I save my values, the output goes crazy and I get like 15k datastore2 messages in there.
21:55:09.513 - ServerScriptService.DataStore2.TableUtil:6: stack overflow
21:55:09.526 - Stack Begin
21:55:09.527 - Script ‘ServerScriptService.DataStore2.TableUtil’, Line 6 - function clone
21:55:21.312 - Script ‘ServerScriptService.DataStore2.TableUtil’, Line 8 - function clone (x16377)
21:55:21.312 - Script ‘ServerScriptService.DataStore2’, Line 46 - function clone
21:55:21.312 - Script ‘ServerScriptService.DataStore2’, Line 181 - function Set
21:55:21.313 - Script ‘ServerScriptService.DataStore2’, Line 389 - function Set
21:55:21.313 - Script ‘ServerScriptService.save_script’, Line 300 - function save_to_model
21:55:21.313 - Script ‘ServerScriptService.save_script’, Line 307
Here is part of my function code (not all of it because i don’t want to share too many scripts.)
terrainxposition,
terrainyposition,
terrainzposition,
terrainxrotation,
terrainyrotation,
terrainzrotation,
terrainxsize,
terrainysize,
terrainzsize,
terrainmaterials,
objectxposition,
objectyposition,
objectzposition,
objectxrotation,
objectyrotation,
objectzrotation = {},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}
-- later in the code...
terrainxpositionStore:Set(terrainxposition)
terrainypositionStore:Set(terrainyposition)
terrainzpositionStore:Set(terrainzposition)
terrainxrotationStore:Set(terrainxrotation)
terrainyrotationStore:Set(terrainyrotation)
terrainzrotationStore:Set(terrainzrotation)
terrainxsizeStore:Set(terrainxsize)
terrainysizeStore:Set(terrainysize)
terrainzsizeStore:Set(terrainzsize)
terrainmaterialsStore:Set(terrainmaterials)
objectxpositionStore:Set(objectxposition)
objectypositionStore:Set(objectyposition)
objectzpositionStore:Set(objectzpositionStore)
objectxrotationStore:Set(objectxrotation)
objectyrotationStore:Set(objectyrotation)
objectzrotationStore:Set(objectzrotation)
I checked that the :Set
function calls weren’t in a for loop and it wasn’t so I tried replacing the function calls with a print statement and it only printed once which makes me believe there is something wrong with my :Set
functions.