Dinobird
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 213 |
|
|
| 06 Sep 2012 07:05 PM |
| how would i get a script to retrieve the position, and size of a brick? |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 07:08 PM |
brick = Workspace[brick name here] pos = brick.Position size = brick.Size print(pos, size) |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 07:10 PM |
> Part.Position > Part.Size |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 07:11 PM |
local Part = game.Workspace.Part
local Size = nil local Position = nil
local PosX = nil local PosY = nil local PosZ = nil
local SizeX = nil local SizeY = nil local SizeZ = nil
PosX = Part.Position.X PosY = Part.Position.Y PosZ = Part.Position.Z
Position = PosX..", "..PosY..", "..PosZ
SizeX = Part.Size.X SizeY = Part.Size.Y SizeZ = Part.Size.Z
Size = SizeX..", "..SizeY..", "..SizeZ
print("Position: "..Position) print("Size: "..Size) |
|
|
| Report Abuse |
|
|
Dinobird
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 213 |
|
|
| 06 Sep 2012 07:24 PM |
| what about taking only like the x or y position? |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 07:33 PM |
Use Mine. Just Remove the Z.
local Part = game.Workspace.Part
local Size = nil local Position = nil
local PosX = nil local PosY = nil
local SizeX = nil local SizeY = nil
PosX = Part.Position.X PosY = Part.Position.Y
Position = PosX..", "..PosY
SizeX = Part.Size.X SizeY = Part.Size.Y
Size = SizeX..", "..SizeY
print("Position: "..Position) print("Size: "..Size)
|
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 07:59 PM |
Or in two lines...
Part = Game.Workspace.Part print("Size: (".. Part.Size.X..", "..Part.Size.Y..")\nPosition: ("..Part.Position.X..", "..Part.Position.Y..")") |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Sep 2012 08:14 PM |
From http://wiki.roblox.com/index.php/String_patterns#Character_Classes
%s| A whitespace character|, \n, and \r |
|
|
| Report Abuse |
|
|
Dinobird
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 213 |
|
|
| 07 Sep 2012 06:58 AM |
| sorry i didn't refresh, then I forgot about this and shut down the pc :P |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2012 04:24 PM |
| I know that "\n" is a line break and "\t" is a tab. |
|
|
| Report Abuse |
|
|