brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 03 Nov 2013 01:14 AM |
while wait() do Humanoid:MoveTo(Vector3.new(284,0,0),Workspace['Point1']) end
Is there anyway to detect when the humanoid is at that position? 284 studs away from Point1. |
|
|
| Report Abuse |
|
|
Conmiro
|
  |
| Joined: 13 Oct 2008 |
| Total Posts: 3393 |
|
|
| 03 Nov 2013 01:17 AM |
I'm not sure why you are using while wait() do for this but...
Is Point1 a position or part?
let's say:
Point1 = part Humanoid:MoveTo(Point1.Position + Vector3.new(284,0,0)) |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 03 Nov 2013 01:18 AM |
Character = script.Parent Humanoid = Character['Humanoid'] Point1 = Workspace['Point1']
while wait() do Humanoid:MoveTo(Vector3.new(284,0,0),Workspace['Point1']) end
|
|
|
| Report Abuse |
|
|
Conmiro
|
  |
| Joined: 13 Oct 2008 |
| Total Posts: 3393 |
|
|
| 03 Nov 2013 01:20 AM |
Character = script.Parent Humanoid = Character['Humanoid'] Point1 = Workspace['Point1']
while wait() do Humanoid:MoveTo(Point1.Position + Vector3.new(284,0,0)) end
|
|
|
| Report Abuse |
|
|
Conmiro
|
  |
| Joined: 13 Oct 2008 |
| Total Posts: 3393 |
|
|
| 03 Nov 2013 01:24 AM |
You say you want to detect when the humanoid is at that position..
Check to see when the humanoid collides with Point1 part using an onTouched function. I can help with that if you need. There's more complicated methods using magnitudes but the method I know uses a lot of scripting cycles. |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 03 Nov 2013 01:24 AM |
01:24:21.077 - Argument 2 missing or nil 01:24:21.078 - Script 'Workspace.Player.Script', Line 6 01:24:21.078 - stack end |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
| |
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Nov 2013 01:26 AM |
Character = script.Parent Humanoid = Character['Humanoid'] Vec = Vector3.new(284,0,0)
--this doesn't require a loop Humanoid:MoveTo(Vec,workspace.Terrain)--workspace.Terrain is valid for the second argument
while (Character.Torso.Position - Vec).magnitude > 5 then -- may need to alter this a bit, but this should suffice wait() end
--[[do the rest of your code here Also note that the second argument of MoveTo serves no purpose other than indicating that the character should walk itself there rather than teleport. workspace.Terrain will always exist, so I find it most efficient. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Nov 2013 01:27 AM |
| I should have ended that long comment with "]]". In ROBLOX it won't cause any errors really, as long as no code is under it, but in standard lua that wouldn't be acceptable. You'll probably delete it anyways. |
|
|
| Report Abuse |
|
|
Conmiro
|
  |
| Joined: 13 Oct 2008 |
| Total Posts: 3393 |
|
|
| 03 Nov 2013 01:28 AM |
Character = script.Parent Humanoid = Character['Humanoid'] Point1 = Workspace['Point1']
pos = Point1.Position + Vector3.new(284,0,0) print(pos) Humanoid:MoveTo(pos, Point1)
|
|
|
| Report Abuse |
|
|
Conmiro
|
  |
| Joined: 13 Oct 2008 |
| Total Posts: 3393 |
|
|
| 03 Nov 2013 01:31 AM |
Character = script.Parent Humanoid = Character['Humanoid'] Point1 = Workspace.Point1 Vec = Point1.Position + Vector3.new(284,0,0)
--this doesn't require a loop Humanoid:MoveTo(Vec,workspace.Terrain)--workspace.Terrain is valid for the second argument
while (Character.Torso.Position - Vec).magnitude > 5 then -- may need to alter this a bit, but this should suffice wait() end
--[[do the rest of your code here Also note that the second argument of MoveTo serves no purpose other than indicating that the character should walk itself there rather than teleport. workspace.Terrain will always exist, so I find it most efficient. |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 03 Nov 2013 01:34 AM |
| Thanks for the help homies! |
|
|
| Report Abuse |
|
|