ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 01 Jan 2014 12:59 AM |
So the repeat works, but after a few seconds it just stops and the for i statement doesn't continue, why?
local Humanoid = script.Parent.Humanoid local Nodes = script.Parent.Parent.Nodes
while wait() do numn = Nodes:GetChildren() for i = 1,#numn do Humanoid:MoveTo(numn[i].Position, numn[i]) repeat wait() until script.Parent.Torso.Position.x < numn[i].Position.x+5 and script.Parent.Torso.Position.x > numn[i].Position.x-5 and script.Parent.Torso.Position.z < numn[i].Position.z+5 and script.Parent.Torso.Position.z > numn[i].Position.z-5 end end |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
| |
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 01 Jan 2014 09:59 AM |
| Capital X and capital Z I think |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 01 Jan 2014 10:01 AM |
thats not an issue
it repeats for like, 5 seconds then stops, and if it hit the node by that time its fine and goes to the next i and the next repeat loop |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 01 Jan 2014 10:02 AM |
http://www.roblox.com/RPG-place?id=139339127
ill show whoever wants to come |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
| |
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 01 Jan 2014 01:26 PM |
why doesnt anyone know whats going on
what is this communism |
|
|
| Report Abuse |
|
|
Thaeh
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 7685 |
|
|
| 01 Jan 2014 01:32 PM |
| could you explain what this is supossed to do? you use a fast repeat for every node, seems like there is a logic error |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 01 Jan 2014 01:36 PM |
| It sends the humanoid to walk to a node, and once it is within a 5x5 perimeter of the node its should walk to the next one |
|
|
| Report Abuse |
|
|
Thaeh
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 7685 |
|
|
| 01 Jan 2014 01:51 PM |
it looks too confusing so i won't even try. i think VectorTo3DRegion or something is better for that, search it up |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 01 Jan 2014 02:10 PM |
| I agree, FindFpartsInRegion3 might be better.. |
|
|
| Report Abuse |
|
|
Thaeh
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 7685 |
|
|
| 01 Jan 2014 02:12 PM |
| all methods and functions built-in roblox are hundreds of times more efficent than user-made ones. that was the case for raycasting. |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 01 Jan 2014 03:41 PM |
| well the nodes are just points for multiple humanoids to reference, I'm not really sure how would implement that, pluse with the huge amount of nodes i plan to have. All this is is simply findning the torso relation to the node, i could probably use magnitude as a better solution |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 01 Jan 2014 05:43 PM |
| ok I switched it to magnitude and as expected, nothing happened. i'm telling you for some reason after a certain number of repeats it just stops for some reason .. |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 01 Jan 2014 05:44 PM |
new code btw
local Humanoid = script.Parent.Humanoid local Nodes = script.Parent.Parent.Nodes
while wait() do numn = Nodes:GetChildren() for i = 1,#numn do Humanoid:MoveTo(numn[i].Position, numn[i]) repeat wait() magnitude = (script.Parent.Torso.Position-numn[i].Position).magnitude until math.abs(magnitude) < 6 end end |
|
|
| Report Abuse |
|
|