My output is displaying 'attempt to index nil with start' even though start is there! I don't know what to do!
function mob.Spawn(name, quantity, map) local mobExists = Mobs:FindFirstChild(name) if mobExists then for i=1, quantity do task.wait(0.5) local newMob = mobExists:Clone() newMob.HumanoidRootPart.CFrame = map:WaitForChild("Start").CFrame newMob.Parent = map.Mob newMob.HumanoidRootPart:SetNetworkOwner(nil) coroutine.wrap(mob.Move)(newMob, map) for i, object in ipairs(newMob:GetDescendants()) do if object:IsA("BasePart") then PhysicsService:SetPartCollisionGroup(object, "Mob") end end end else warn(name .. " isn't there!") end end
Map was somehow nil and I moved all the important folders out and it worked.