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 
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
14 Jan 2012 04:23 PM
Could someone give me an example of using Magnitude on GUI's?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
14 Jan 2012 04:25 PM
No requests.

Plus that's advanced. As of what swimguy777 accomplished.
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
14 Jan 2012 04:27 PM
It's me though:3
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
14 Jan 2012 04:27 PM
Can you...? It returns the distance between two objects in game, can two GUI's fill those objects?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
14 Jan 2012 04:30 PM
@neon

Yes it can.

@Ufail

I know it's you :P
You're mai little fuzzy cuddle bear :D But this is really advanced...
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
14 Jan 2012 04:32 PM
I'll do it by myself then...
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
14 Jan 2012 04:32 PM
Ok just ask you're brother!!!!!LOL

Dude, just ask him!
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
14 Jan 2012 04:36 PM
:P

He will see this forum soon enough.
Report Abuse
Miksterman is not online. Miksterman
Joined: 28 Dec 2008
Total Posts: 397
14 Jan 2012 04:38 PM
This needs to be run form a localscript as it uses AbsoluteSize.

function MagnitudeGui(Object1, Object2)
Pos1 = Object1.Position
Pos2 = Object2.Position
X = {(Pos1.X.Offset+(Pos1.X.Scale*Object1.Parent.AbsoluteSize.X)), (Pos2.X.Offset+(Pos2.X.Scale*Object1.Parent.AbsoluteSize.X))}
Y = {(Pos1.Y.Offset+(Pos1.Y.Scale*Object1.Parent.AbsoluteSize.Y)), (Pos2.Y.Offset+(Pos2.Y.Scale*Object1.Parent.AbsoluteSize.Y))}
return math.sqrt((X[2]-X[1])^2+(Y[2]-Y[1])^2))
end
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
14 Jan 2012 04:38 PM
-_-

GET OFF YOUR SACK AND TELL HIM TO HELP HIM! IF HE DOESN'T HELP BEAT HIM UP UNTIL HE DoES :P
Report Abuse
Miksterman is not online. Miksterman
Joined: 28 Dec 2008
Total Posts: 397
14 Jan 2012 04:39 PM
Oh It returns the distance in Pixels BTW.
Report Abuse
Miksterman is not online. Miksterman
Joined: 28 Dec 2008
Total Posts: 397
14 Jan 2012 04:40 PM
Also I wrote that on the spot so it may have some error. Sorry for multiple posts.
Report Abuse
Smirky is not online. Smirky
Joined: 05 Apr 2008
Total Posts: 3598
14 Jan 2012 04:47 PM
I don't believe Gui objects have magnitude by default. I'm fairly certain you have to make customize it.
Report Abuse
Smirky is not online. Smirky
Joined: 05 Apr 2008
Total Posts: 3598
14 Jan 2012 04:48 PM
Well, I guess I was a little bit late on that.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
14 Jan 2012 05:15 PM
Yes you were...
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
14 Jan 2012 05:42 PM
just to add to this... there a thread i have tracked that relates to this. it might be useful
http://www.roblox.com/Forum/ShowPost.aspx?PostID=54712496

~I've been to nil and back.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
14 Jan 2012 05:50 PM
@MrGame

When do you learn math.sqrt? I mean in school?
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
14 Jan 2012 05:53 PM
... not sure where that question came from, but uh.... hmmm... quite a while ago. elementary school maybe? i'm in 10th grade now.

~I've been to nil and back.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
14 Jan 2012 05:55 PM
-_-

Explain what it does? And in what, algebra?
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
14 Jan 2012 05:58 PM
well, math.sqrt just finds the square root of a number. the square root is the number of.... uhmmm... the number of times a number of times a number goes into that number of numberness and numbers and stuff :D? its been to long, the calculator has ruined me :P

~I've been to nil and back.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
14 Jan 2012 06:00 PM
-_-

Erm...Ok?
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
14 Jan 2012 08:27 PM
Don't over-complicate things:

local Mag = (Vector2.new(Obj1X, 0) - Vector2.new(Obj2X, 0).magnitude
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
14 Jan 2012 08:40 PM
-.-

local Mag = (Vector2.new(Obj1X, 0) - Vector2.new(Obj2X, 0).magnitude)
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
14 Jan 2012 08:45 PM
^

~I've been to nil and back.
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
14 Jan 2012 08:45 PM
Thanks guys.
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