generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Argument 2 missing or nil

Previous Thread :: Next Thread 
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
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 is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
04 Sep 2016 01:45 PM
what line has the problem


$.git('http://Gud',{})
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
04 Sep 2016 01:46 PM
It the link I pointed out, if you simply look at the script...
Report Abuse
Isosta is not online. 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
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
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 is not online. 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
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
04 Sep 2016 02:00 PM
Did, but it was at 3 in the morning...
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
04 Sep 2016 02:02 PM
Unable to cast Array to Vector3
Report Abuse
Kodran is not online. 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
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
04 Sep 2016 02:08 PM
http://wiki.roblox.com/index.php?title=API:Class/Path/GetPointCoordinates
Report Abuse
Kodran is not online. 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
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
04 Sep 2016 02:11 PM
I don't have them on, because glasses + headset = rip.
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image