hi my script is not working is there something wrong with it
This is the erorr: ServerScriptService.Main.Mob:27: attempt to index nil with 'Start'
here is the code of the module script:
`local ServerStorage = game:GetService("ServerStorage")
local mob = {}
function mob.Move(mob, map)
local humanoid = mob:WaitForChild("Humanoid")
local waypoints = map.Waypoints
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
-- move into workspace
local newMob = mobExists:Clone()
newMob.HumanoidRootPart.CFrame = map.Start.CFrame
newMob.Parent = workspace
coroutine.wrap(mob.Move)(newMob, map)
else
warn("Requested mob does not exist: ", name)
end
end
return mob
here is the code of hte main script:
local mob = require(script.Mob)
local map = workspace.Grassland
for i=1, 3 do
mob.Spawn("Zombie", map)
task.wait(1)
end`