Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i get the brick's size in numbers, and only the x and z (no y)?

I am making a gui where the size of the frame changes as the size of the block changes. How would I get the size of a block, and only the x and z?

frame= Instance.new('Frame')
frame = script.Parent.Size.X * 2
frame = script.Parent.Size.Z * 2

please help!!! Thank you!!!

[EDIT] I realized that ******.X or Z isn't possible, is there a way to just get the first number and the third number?

1 comment

0

Actually, it is possible. You just need to use UDim2 values. Also, you can scale the frame instead of getting the size, since it's much easier.

2 answers

Frames use something called a UDim2, not Vector3. When you want to find the x value, say frame.Size.X. This returns a UDim, which has a scale and offset property. If you're using the scale (the first number, goes from 0.1 to 1), say frame.Size.X.Scale, for offset frame.Size.X.Offset. You can also do the same thing for the Y axis.

If you're looking to resize your frame (kind of like using BodyPosition), check out:

http://wiki.roblox.com/index.php?title=Tweening

How to use UDim2's to manipulate size:

http://wiki.roblox.com/index.php?title=UDim2

1 comment

0

This kind of helps! thank you! I found out the problem though, thanks!

There's n arrow next to 'Size' in the properties of the brick, click that and it. will give you the X, Y, Z cords.

This discussion is preserved as it was. New answers, comments, and votes are closed.