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: How would u do this?

Previous Thread :: Next Thread 
Dinobird is not online. 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
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
06 Sep 2012 07:08 PM
brick = Workspace[brick name here]
pos = brick.Position
size = brick.Size
print(pos, size)
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
06 Sep 2012 07:10 PM
> Part.Position
> Part.Size
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
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 is not online. 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
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
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
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
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
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
06 Sep 2012 08:12 PM
Whats the /n?
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
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 is not online. 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
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Sep 2012 04:24 PM
I know that "\n" is a line break and "\t" is a tab.
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