|
| 04 Sep 2016 01:43 PM |
local torso = script.Parent:WaitForChild('Torso')
while wait(0.05) do for _,v in pairs(game.Players:GetPlayers()) do if v then if v.Character.Torso and (torso.Position - v.Character.Torso.Position).magnitude <= 28 then print((torso.Position)) print((v.Character.Torso.Position)) local vectorstuff = Vector3.new(torso.Position, v.Character.Torso.Position, 40) print(vectorstuff) local get = game:GetService("PathfindingService"):ComputeSmoothPathAsync(vectorstuff) --this line script.Parent.Humanoid:MoveTo(get:GetPointCoordinates()) end end end end |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 04 Sep 2016 01:45 PM |
what line has the problem
$.git('http://Gud',{}) |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2016 01:46 PM |
| It the link I pointed out, if you simply look at the script... |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 04 Sep 2016 01:48 PM |
you provided a start vector but not a finish vector.
$.git('http://Gud',{}) |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2016 01:57 PM |
local torso = script.Parent:WaitForChild('Torso')
while wait(0.05) do for _,v in pairs(game.Players:GetPlayers()) do if v then if v.Character.Torso and (torso.Position - v.Character.Torso.Position).magnitude <= 28 then print((torso.Position)) print((v.Character.Torso.Position)) local get = game:GetService("PathfindingService"):ComputeSmoothPathAsync( torso.Position, --NPC v.Character.Torso.Position, --Target 40--Something I have to put here ) script.Parent.Humanoid:MoveTo(get:GetPointCoordinates()) end end end end |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 04 Sep 2016 01:58 PM |
http://wiki.roblox.com/index.php?title=API:Class/PathfindingService/ComputeSmoothPathAsync
maxDistance Type: float Required
did you even read this before coming here to ask why it doesn't work?
|
|
|
| Report Abuse |
|
|
|
| 04 Sep 2016 02:00 PM |
| Did, but it was at 3 in the morning... |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2016 02:02 PM |
| Unable to cast Array to Vector3 |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 04 Sep 2016 02:05 PM |
Clearly you're passing a table when you should be passing a vector3. Probably your getPointCoordinates function returns a table.
|
|
|
| Report Abuse |
|
|
|
| 04 Sep 2016 02:08 PM |
| http://wiki.roblox.com/index.php?title=API:Class/Path/GetPointCoordinates |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 04 Sep 2016 02:11 PM |
Returns: array(Vector3) Description: Returns table of Vector3's that comprise the Path.
You really need to grab some reading glasses lol.
|
|
|
| Report Abuse |
|
|
|
| 04 Sep 2016 02:11 PM |
| I don't have them on, because glasses + headset = rip. |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2016 02:13 PM |
local torso = script.Parent:WaitForChild('Torso')
while wait(0.05) do for _,v in pairs(game.Players:GetPlayers()) do if v then if v.Character.Torso and (torso.Position - v.Character.Torso.Position).magnitude <= 28 then print((torso.Position)) print((v.Character.Torso.Position)) local get = game:GetService("PathfindingService"):ComputeSmoothPathAsync( torso.Position, --NPC v.Character.Torso.Position, --Target 40--Something I have to put here )
print(get)
--script.Parent.Humanoid:MoveTo(get) end end end end
>0.299930006, 2.94114065, -17.599987 -0.392412812, 2.99963999, 9.98752117 Instance |
|
|
| Report Abuse |
|
|