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: In Distance?

Previous Thread :: Next Thread 
CardsOfFate is not online. CardsOfFate
Joined: 08 Jul 2014
Total Posts: 761
30 Mar 2015 07:15 PM
If the player is 10 studs away from the torso do something..

How?
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
30 Mar 2015 07:16 PM
if Player:DistanceFromCharacter(PART.Position) <= 9001 then --[[dothis]] end
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
30 Mar 2015 07:19 PM
or use magnitude
Report Abuse
CardsOfFate is not online. CardsOfFate
Joined: 08 Jul 2014
Total Posts: 761
30 Mar 2015 07:20 PM
Whats the difference between the both?
Report Abuse
CardsOfFate is not online. CardsOfFate
Joined: 08 Jul 2014
Total Posts: 761
30 Mar 2015 07:21 PM
PART.Position

is this where I define like plr.Character.Torso.Position?
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
30 Mar 2015 07:23 PM
First: Mine is easier, but it only works if you're trying to figure out a player's distance from something.

Second: Yes. It can be any Vector3 value
Report Abuse
CardsOfFate is not online. CardsOfFate
Joined: 08 Jul 2014
Total Posts: 761
30 Mar 2015 07:24 PM
See this bit here:

local plr = game.Players.LocalPlayer
if plr:DistanceFromCharacter(plr.Character.Torso.Position) <= 20 then

Where would I define what its looking for? because if I don't wont it just go for any brick? also.. Is it possible to return what it has found so I can also edit the thing it has located?
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