while true do randround = math.random(1,1) wait(1) if randround == 1 and game.ReplicatedStorage.NumberOfModels.Value < 220 then for f = 1,15 do wait(.5) for _,od in pairs(Lighting.ODers:GetChildren()) do randod = (od[math.random(#od)]) randod.Parent = workspace randod:MoveTo(workspace:WaitForChild("EnabledSpawnBrick").Position + Vector3.new(0,10,0)) randod:MakeJoints() end end timer() msg:Destroy() end
local pickzom = math.random(1,3) wait(.5) if pickzom == 1 then zh = Lighting.Zombie:clone() zh.Parent = workspace zh:MoveTo(workspace:WaitForChild("EnabledSpawnBrick").Position + Vector3.new(0,10,0)) zh:MakeJoints()
If you want a random clone from that just do
Model = blah clone = Model:GetChildren()[math.random(1,#Model:GetChildren())]:Clone()
while true do randround = math.random(1,1) wait(1) if randround == 1 and game.ReplicatedStorage.NumberOfModels.Value < 220 then for f = 1,15 do wait(.5) for number,od in pairs(game.Lighting.ODers:GetChildren()) do -- forgot datamodel randod = (Lighting.ODers:GetChildren()[math.random(number)]) -- don't even want to explain this... randod.Parent = workspace randod:MoveTo(workspace:WaitForChild("EnabledSpawnBrick").Position + Vector3.new(0,10,0)) randod:MakeJoints() end end timer() -- don't even know what this is... msg:Destroy() -- this too. end -- forgot an end... end
All these errors are simple debugging mistakes, and the output would explain it better then me.
Alright. This has a lot of problems but I put something together for you.
The problems are as listed:
models[math.random(1, #models)]
Solution:
local ODers = game.Lightning.ODers:GetChildren() while true do wait(1) if game.ReplicatedStorage.NumberOfModels.Value < 220 then for f = 1,15 do wait(.5) randod = ODers[math.random(1, #ODers)] randod.Parent = workspace randod:MoveTo(workspace:WaitForChild("EnabledSpawnBrick").Position + Vector3.new(0,10,0)) end end timer() msg:Destroy() end