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 » Scripting Helpers
Home Search
 

Re: Magnitude

Previous Thread :: Next Thread 
redfart is not online. redfart
Joined: 17 Oct 2008
Total Posts: 1021
09 Jan 2013 05:33 PM
Is there any way to have say a number value, and at any point in time this number value tells you how many people are within a certain distance of a brick?
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
09 Jan 2013 05:34 PM
Yes.
Report Abuse
redfart is not online. redfart
Joined: 17 Oct 2008
Total Posts: 1021
09 Jan 2013 06:24 PM
Lol what is it?
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
09 Jan 2013 06:31 PM
One way would be to have an infinite loop compare the distance from each player's torso to the part, and add one for each player that is closer than the threshold.
Report Abuse
redfart is not online. redfart
Joined: 17 Oct 2008
Total Posts: 1021
09 Jan 2013 06:39 PM
I know how to to that

But how would I account for when somebody leaves the area?
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
09 Jan 2013 06:41 PM
That is dealt with in this procedure. It starts a new count from scratch every time.
Report Abuse
redfart is not online. redfart
Joined: 17 Oct 2008
Total Posts: 1021
09 Jan 2013 07:19 PM
Could you explain how to do that?
Report Abuse
popdosprlte is not online. popdosprlte
Joined: 18 Dec 2009
Total Posts: 4801
09 Jan 2013 08:52 PM
Make a table of character torsos in the workspace. Update this constantly. Check if nil when applying function. Ta-Dah! Foolproof.
Report Abuse
LFMEB is not online. LFMEB
Joined: 31 May 2012
Total Posts: 66
09 Jan 2013 08:53 PM
un-efficient.
Report Abuse
popdosprlte is not online. popdosprlte
Joined: 18 Dec 2009
Total Posts: 4801
09 Jan 2013 08:54 PM
Make a table of all the torsos in the workspace. When a child is added or removed from the workspace, update the table. Always check if nil when applying function additionally.
Report Abuse
NotYetRendered is not online. NotYetRendered
Joined: 30 Dec 2012
Total Posts: 8
10 Jan 2013 03:52 PM
part1 = game.Workspace.Part1

part2 = game.Wokrspace.Part2

while true do wait()

print("Distance: "..(part1.Position - part2.Position.magnitude))
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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