|
| 09 Jul 2011 03:49 PM |
function poses() pos1 = game.Workspace.Part.Position pos2 = game.Workspace.Part2.Position if (pos1 - pos2).magnitude > 10 then pos1:remove() pos2:remove() end poses() end
No, output... |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:50 PM |
Let me try it, I don't think there are any errors in it
~ Mitch ~ |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:51 PM |
Try this,
function poses() pos1 = game.Workspace.Part.Position pos2 = game.Workspace.Part2.Position if (pos1 - pos2).magnitude > 10 then pos1:remove() pos2:remove() elseif (pos1 - pos2).magnitude <= 10 then poses() end end
|
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:51 PM |
Wait, probably because you called poses in the wrong spot. It should be
end end poses()
~ Mitch ~ |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 09 Jul 2011 03:51 PM |
pos1 = game.Workspace.Part.Position pos2 = game.Workspace.Part2.Position function poses() if (pos1 - pos2).magnitude < 10 then pos1:remove() pos2:remove() end poses() end
I also tried that... That really should of worked... |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:52 PM |
| I think he wants it to be recursive so if a part gets within that range they are removed. |
|
|
| Report Abuse |
|
|
Vultraz
|
  |
| Joined: 03 Jul 2008 |
| Total Posts: 1289 |
|
|
| 09 Jul 2011 03:52 PM |
| Maybe you should do a while loop to constantly recheck..? |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 09 Jul 2011 03:53 PM |
Try this instead, 2nd attempt :
function poses() pos1 = game.Workspace.Part pos2 = game.Workspace.Part2 if (pos1.Position - pos2.Position).magnitude > 10 then pos1:remove() pos2:remove() end poses() end
|
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:53 PM |
Found the error. You are calling remove on the position, not the part
~ Mitch ~ |
|
|
| Report Abuse |
|
|
Vultraz
|
  |
| Joined: 03 Jul 2008 |
| Total Posts: 1289 |
|
|
| 09 Jul 2011 03:53 PM |
| No, I'm pretty sure it's end end poses() |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:53 PM |
When I put it there I got this error:
Sat Jul 09 16:51:49 2011 - remove is not a valid member Sat Jul 09 16:51:49 2011 - Workspace.Script, line 5 - global poses Workspace.Script, line 9 stack end Sat Jul 09 16:51:49 2011 - Workspace.Script, line 5 - global poses Workspace.Script, line 9 stack end
I tried to put the pose there first, but I got that... |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:54 PM |
Exactly, look at my last post
~ Mitch ~ |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:54 PM |
Hey guys, when a function calls itself, it's RECURSIVE.
function example(asd) print(asd) wait(.1) example(asd) end example("lol")
> lol > lol > lol > lol > lol > lol > lol > lol > lol ... |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:55 PM |
| OH MY GOD, thank you crazy and 613! I forgot Position can't be removed. I was trying to remove the part... Dur. LOL! |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:56 PM |
| 0mG ; h4x hao nnune notice that D: |
|
|
| Report Abuse |
|
|