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: This or that, A question on efficany

Previous Thread :: Next Thread 
VineyardVine is not online. VineyardVine
Joined: 20 Nov 2010
Total Posts: 904
23 Dec 2015 08:50 PM
Say I am trying to fire a event based on how close a humanoid is to a part which method would be more efficient

1) Using a loop to constantly check the distance between the two objects

2) Using the changed event on a moving part such as the torso to check the distance


There is probably a better way I just did not want to come to this question empty handed
Report Abuse
VineyardVine is not online. VineyardVine
Joined: 20 Nov 2010
Total Posts: 904
23 Dec 2015 08:51 PM
^efficacy
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
23 Dec 2015 08:53 PM
if it's between those two, use the loop. atleast then you can change the polling interval, with the Changed event you can't limit the speed.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
23 Dec 2015 08:55 PM
I'll second that on the loop, simply because Changed doesn't actually fire for physics.
Report Abuse
Zztheses is not online. Zztheses
Joined: 29 Jun 2013
Total Posts: 94
23 Dec 2015 08:55 PM
Use the loop
Report Abuse
KapKing47 is not online. KapKing47
Joined: 09 Sep 2012
Total Posts: 5522
23 Dec 2015 08:57 PM
.Changed is better for something that doesn't update that fast
Loop is better for something that needs to be done fast

So when the person is AFK it would be better to use .Changed, cos a loop will run even if he's not there which could be slowing down other scripts, but in loops u can change the interval, so I'd say choose loops.

"My Life is going Good... but..."
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