So I am trying to make the "Mob" aka ambush move, I don't remember how I did it before with another game so instead I copied the code:
script.Parent.MouseButton1Click:Connect(function()
local mob = workspace.Ambush
function mob.Move(mob, workspace)
local humanoid = mob:WaitForChild("Humanoid")
local waypoints = workspace.Waypoints
for waypoint=1, #waypoints:GetChildren() do
humanoid:MoveTo(waypoints[waypoint].Position)
humanoid.MoveToFinished:Wait()
end
end
end)
It isn't working. Anyone know why and how to help pls?

8 comments
Cant confirm, so not putting it as a answer. I believe it may be because mob.Move needs mob to be a table, however it does not look like it is one. Is ambush something like a folder or is it a module script? If its a module script you need to call require() around it.
it's a model
https://youtu.be/JSbSFWLTmYU
Add prints around it, I think that might be why then.
You're using the function like you're trying to call it as if it were stored inside of a table. Since "mob" is an object, it's trying to find a member inside of the object that has the name "Move"; which explains the error you're receiving. To solve this particular error, you can either remove the "mob." next to the function name or remove the function itself as it seems unnecessary here.
You may be confused with pathfinding? From what I can gather, it looks like you're trying to pathfind the NPC but may be confused on how it works or have forgotten. If I'm correct, it might be worth your time looking at the documentation for pathfinding. https://create.roblox.com/docs/mechanics/pathfinding
Nothing is working?
The first comment might work i Just don't know where you want me to call require