I know nothing about stuff f like this, so help would be appreciated :)

I am making a zombie that goes to a certain part when it has no target

Part of the script:

function walkRandomly()
	local xRand = math.random(-50,50)
	local zRand = math.random(-50,50)
	local goal = myRoot.Position + Vector3.new(xRand,0,zRand)
		 
	local path = game:GetService("PathfindingService"):CreatePath() path:ComputeAsync(myRoot.Position, goal)
	local waypoints = path:GetWaypoints()
		 
	if path.Status == Enum.PathStatus.Success then
	for _, waypoint in ipairs(waypoints) do
	if waypoint.Action == Enum.PathWaypointAction.Jump then
	myHuman.Jump = true
	end

2 comments

0

You don't even have a function where you find a target, you only hand us the walk random, which gives us, (in my opinion) nothing to start from.

0

I can give you the whole script. I'll make a new question