Error that I cannot find out what it means

So I was watching a quick tutorial on something and I changed the script a bit and got this error.


I didn’t know what it was so I copied the tutorials script exactly and still got the error.

local PhysicsService = game:GetService("PhysicsService")
local ServerStorage = game:GetService("ServerStorage")
local mob = {}

function mob.Move(mob, map)
	local humanoid = mob:WaitForChild("Humanoid")
	local waypoints = map.waypoint

	for waypoint=1, #waypoints:GetChildren() do
		humanoid:MoveTo(waypoints[waypoint].Position)
		humanoid.MoveToFinished:Wait()
	end
	
	mob:Destroy()
end

function mob.Spawn(name, quantity, map)
	local mobExists = ServerStorage.Mobs:FindFirstChild(name)
	
	if mobExists then
		for i=1, quantity do
			task.wait(0.5)
			local newmob = mobExists:Clone()
			newmob.HumanoidRootPart.CFrame =  map.spawn.CFrame
			newmob.Parent = map.mobholder
			
			for i, object in ipairs(newmob:GetDescendants())do
				if object:IsA("BasePart")then
					PhysicsService:SetPartCollisionGroup(newmob, "Mob")
				end
			end
			coroutine.wrap(mob.Move)(newmob, map)
		end
	else
		warn(name,":Mob does not exist")
	end
end

What line is the error in? You can also try changing

local mob = {}

to

local mob = []

I don’t really know, can you tell me if it works?

newmob is passed inside SetPartCollisionGroup() which only accepts BaseParts perhaps you wanted to use object?

1 Like

I’m not a professional, but does BasePart in SetPartCollisionGroup?

Yuh, I was told by people on discord about that mistake. Thank you

The error message said line 29 and also the

local mob = {}

was just the module script start