|
| 27 May 2012 03:50 PM |
So im wondering what would be an efficent way of detecting if a part is near another
say i wanted to make a gun , where when you are near a Crate of ammo , a gui apears saying "Press E to pick up ammo"
I tought of "GetChildren" The whole workspace and keep detecting if its near , but thats kinda laggy
I dont want OnTouch
I heard of some "PartNearRegion" thing or whatever , what is that , how do you use it? |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 May 2012 04:16 PM |
| so you f5ing now? go away! |
|
|
| Report Abuse |
|
|
|
| 27 May 2012 04:19 PM |
Just trying to have a star near the post so its a bit more visible.
|
|
|
| Report Abuse |
|
|
|
| 27 May 2012 04:20 PM |
-.-'
Thats spawming, and people here dont like it. |
|
|
| Report Abuse |
|
|
Moolah101
|
  |
| Joined: 22 Sep 2010 |
| Total Posts: 614 |
|
|
| 27 May 2012 04:22 PM |
Well, its not spamming...
Besides it got me going to it lol. |
|
|
| Report Abuse |
|
|
|
| 27 May 2012 05:01 PM |
"people here"
you got a couple posts and joined 2012
who r u anyway |
|
|
| Report Abuse |
|
|
ozza
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 726 |
|
|
| 27 May 2012 05:10 PM |
So, a loop would be a great way
for i, v in pairs(game.Players:GetChildren()) do if (script.Parent.Position-v.Character.Torso.Position).magnitude < 25 then -- gui end end
- ogm i r no nob y u noob |
|
|
| Report Abuse |
|
|
|
| 28 May 2012 12:33 AM |
I asked if theres another way other than GetChildren
and you show me a GetChildren script
i dont want one that scans the whole workspace every 0.1 second
Because the script is in the player , not in the ammo box |
|
|
| Report Abuse |
|
|
eletr0wiz
|
  |
| Joined: 02 Mar 2010 |
| Total Posts: 138 |
|
|
| 28 May 2012 12:37 AM |
Right now that is impossible as no scripts can access the mouse movement without tools or hopperbins... However roblox talks about adding this in the future... |
|
|
| Report Abuse |
|
|