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?
local mob = workspace.Ambush function mob.Move(mob, workspace)
The function will not work as the mob, which is A Model
, cannot have custom functions set to it. Someone already answered your question (credit to xInfinityBear). You should create a module for your functions, or name the function something else and call it