Hi there everyone. I’m in a dev team with 5 others working on an open source game (an open world survival game) that was made during 2011, and was just recently fixed. More specifically, we are creating a new variant of the game set in the sky (using the fixed version’s components) as a passion project and we are running into issues with the resource system as we update the game.
Here’s what’s causing the issue:
and here’s part of the script with the functions that were (possibly?) involved with said line (line 7-13):
local Load = require(game.ReplicatedStorage:WaitForChild("Load"))
local DataAccessor = Load "Data.DataAccessor"
----------------------------------------
----- Objects --------------------------
----------------------------------------
local resourceRoot = workspace.Resources
Line 30-52:
local function ChooseRandomChild(root)
local children = root:GetChildren()
if #children == 0 then
return nil
end
math.randomseed(tick())
return children[math.random(1, #children)]
end
local function ResolveCluster(cluster)
local chosen = ChooseRandomChild(cluster)
for _, child in ipairs(cluster:GetChildren()) do
if child ~= chosen then
child:Destroy()
end
end
chosen.Parent = resourceRoot
end
I am by no means to most people a Lua “professional” so I’m extremely lost with trying to figure out what’s wrong here. This is breaking the respawn system within the same core script as displayed and I need it fixed asap as it is game breaking. Could anyone help me to solving this issue somehow (example code would be appreciated if possible)?