Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PathFinder = require(ReplicatedStorage.Modules.PathFinding);
- local findPath = PathFinder.findPath
- local findClosestNode = PathFinder.findClosestNode;
- local function FindPath(start,destination)
- local foundnode = findClosestNode(start);
- local foundend = findClosestNode(destination);
- if foundnode and foundend then
- local foundpath = findPath(foundnode,foundend);
- if foundpath then
- local temp = {};
- for i,v in pairs(foundpath) do
- temp[i]=v.Position;
- end
- return temp;
- else
- return nil;
- end
- else
- error("Closest node(s) not found!");
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement