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