menu
Roblox Forum Archive
Home
User Search
Forums
Donate
search
settings
Home
User Search
Forums
Donate
launch
Go to User Dashboard
Forums
Scripting Helpers
Distance
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right
Distance
Fluent_Lua
Join Date: 2011-10-03
Post Count: 1290
#138460523
Saturday, June 28, 2014 4:08 AM GMT
I wanted to know how to calculate the studs apart from 2 bricks?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
AnonyAnonymous
Join Date: 2013-06-23
Post Count: 6332
#138460603
Saturday, June 28, 2014 4:09 AM GMT
You could use magnitude, game.Workspace.Part.Position.Magnitude
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Brick_man
Join Date: 2009-11-20
Post Count: 5634
#138460609
Saturday, June 28, 2014 4:09 AM GMT
(Part1.Position-Part2.Position).magnitude
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Fluent_Lua
Join Date: 2011-10-03
Post Count: 1290
#138460725
Saturday, June 28, 2014 4:11 AM GMT
so brick1 = game.Player1.Torso brick2 = game.Player2.Torso dis = (brick1.Position-brick2.Position).magnitude print(dis) would that work?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
nomer888
Join Date: 2010-02-13
Post Count: 551
#138460737
Saturday, June 28, 2014 4:11 AM GMT
part1.Position - part2.Position
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
AnonyAnonymous
Join Date: 2013-06-23
Post Count: 6332
#138460933
Saturday, June 28, 2014 4:13 AM GMT
Brick1 = game.Player1.Character.Torso Brick2 = game.Player.Character.Torso (Brick1.Position - Brick2.Position).Magnitude
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
nomer888
Join Date: 2010-02-13
Post Count: 551
#138460998
Saturday, June 28, 2014 4:13 AM GMT
Another way to calculate the distance is not to listen to me, and listen to those who are correct. Other than my being tired, yes, that should work.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Fluent_Lua
Join Date: 2011-10-03
Post Count: 1290
#138461322
Saturday, June 28, 2014 4:17 AM GMT
ok, thanks, I got it
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
AnonyAnonymous
Join Date: 2013-06-23
Post Count: 6332
#138461355
Saturday, June 28, 2014 4:17 AM GMT
Don't worry, we all have the common goal to help the user creating the top, right?, well we all make daily errors and it's these same errors that help us significantly although it may make us feel terrible.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right