XJonJonX
|
  |
| Joined: 31 Dec 2013 |
| Total Posts: 14 |
|
|
| 29 Jul 2014 12:14 AM |
This script is edited from 1waffle1's script and is not working.
There are no errors in it, the following just never returns true 'if Path.Status==Enum.PathStatus.Success then'
Source:
local Pathfinding=game:GetService("PathfindingService") function WalkPath(Goal) local Path=Pathfinding:ComputeRawPathAsync(script.Parent.Torso.Position,Goal,500) if Path.Status==Enum.PathStatus.Success then local Points=Path:GetPointCoordinates() for i,v in pairs(Points) do local part,P=workspace:FindPartOnRay(Ray.new(v,Vector3.new(0,-10,0))) if part then v=P Points[i]=P end end local Break=false local Distance; for i=1,#Points,2 do local Point=Points[_] if Break then break end local Count=0 repeat Count=Count+1 if Count>100 then Break=true break end script.Parent.Humanoid:MoveTo(Points[math.min(#Points,i+1)]) if Point.Y>=v.Humanoid.Torso.Position.Y-1 then script.Parent.Humanoid.Jump=true end Distance=(Points*Vector3.new(1,0,1)-script.Parent.Torso.Position*Vector3.new(1,0,1)).magnitude wait() until Distance<5 end else script.Parent.Humanoid:MoveTo(script.Parent.Torso.CFrame*Vector3.new(0,0,5)) end end wait(3) WalkPath(Vector3.new(0,0,50)) |
|
|
| Report Abuse |
|
|
XJonJonX
|
  |
| Joined: 31 Dec 2013 |
| Total Posts: 14 |
|
|
| 29 Jul 2014 07:59 AM |
Now I've realized it's not the script
I edited 1waffle1's game, tested it, and it worked, though when I copied the needed models and script into my game, it didn't work...
Anything I need to Enable? |
|
|
| Report Abuse |
|
|
XJonJonX
|
  |
| Joined: 31 Dec 2013 |
| Total Posts: 14 |
|
|
| 29 Jul 2014 08:05 AM |
| Every time, no matter what I do, the Status is always ClosestNoPath |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2014 08:08 AM |
| i dunno how to use path finding. maybe you can teach me. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2014 08:13 AM |
"script.Parent.Humanoid:MoveTo(Points[math.min(#Points,i+1)])"
Humanoid:MoveTo (singlevalue)
Doesn't it need a coord to go to?
How does dat work? :o |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2014 08:14 AM |
Using :MoveTo(Vector3.new(0,0,0)
on a humanoid makes them walk to a certain coordinate that was set. |
|
|
| Report Abuse |
|
|
XJonJonX
|
  |
| Joined: 31 Dec 2013 |
| Total Posts: 14 |
|
|
| 29 Jul 2014 08:14 AM |
It loops through each Coordinate and moves to it
Point is a Coordinate in the path |
|
|
| Report Abuse |
|
|
XJonJonX
|
  |
| Joined: 31 Dec 2013 |
| Total Posts: 14 |
|
| |
|
XJonJonX
|
  |
| Joined: 31 Dec 2013 |
| Total Posts: 14 |
|
|
| 29 Jul 2014 08:16 AM |
http://prntscr.com/47h64i
Hope ROBLOX doesn't mind...
Note, This link is purely for educational purposes. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2014 08:34 AM |
| im a scripting noob srry above my level |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 29 Jul 2014 09:01 AM |
@Jon What do i need to make this work? Can you make it simple?
|
|
|
| Report Abuse |
|
|
mu6666mu
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 952 |
|
|
| 29 Jul 2014 09:10 AM |
Jon is my Alt
This should be placed in an NPC
local Pathfinding=game:GetService("PathfindingService") local Char=script.Parent local Path=Pathfinding:ComputeRawPathAsync(Position1,Position2,MaxDistance) if Path.Status==0 then local Points=Path:GetPointCoordinates() for i,v in pairs(Points) do Char.Humanoid:MoveTo(v) repeat wait() until (Char.Torso.Position-v).magnitude <5 end end
This is the basic script... |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 29 Jul 2014 09:21 AM |
The script is still not working, i put one in a npc and it just stood. I have nodes and points, what am i doing wrong? |
|
|
| Report Abuse |
|
|
mu6666mu
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 952 |
|
|
| 29 Jul 2014 09:35 AM |
| It's not working for me either, always returns ClosestNoPath for Status |
|
|
| Report Abuse |
|
|