--UDim2 script by bossay123 while true do script.Parent.Parent.Frame:TweenPosition(UDim2.new(0,-1,0)) wait(2) script.Parent.Parent.Frame:TweenPosition(UDim2.new(0,1,0)) print(work)-- work is highlighted red end
Work is hilighted red, but in the output there are no errors.
Well It seems like all of you are clueless.
Firstly
UDim2.new() Takes four arguements . first is X Size
, Next is X Offset
, Then .. Y Size
, and Lastly Y Offset
. Which would look like this in a script
UDim2.new(0.1,0,0.2,0)
Secondly
The Method :TweenPosition
Also Takes four Arguments. it takes
UDim2 Position
, Then Easing Direction
, Then Easing Style
, And Lastly Time
The Different Easing Directions are:
In
Out
InOut
The Different Easing Styles are:
Quad
Back
Linear
Elastic
Bounce
Sine
Quart
Quint
The Links
Example
local frame --Set it equal to the frame object frame:TweenPosition(UDim2.new(0.,3,0,0.4,0),'In','Quad',5)
Lastly
Besides :TweenPosition()
there is Also :TweenSize()
which takes the same arguments as Tween Position but smoothly Changes the Size of the Gui Object.
UDim2
has four values to be go inside of it. These are X Scale
, X Offset
, Y Scale
and Y Offset
Also, work doesn't seem to be defined.
UDim2
UDim2
needs four values in it instead of three like Vector3
. There are two types of values that go into UDim2
. Scale
and Offset
. Now let me explain each of them.
Scale
Scale is more of a ratio based on the screen size of the device/Parent of the gui. The values go to 0-1, 0 is nothing on that axis while 1 fills the whole parent on the axis. Although this can lead to much stretching of images if you're not okay with that.
Offset
Offset is based on pixels. it does NOT size or position itself based on the screen. so if you put the value as say 50, its 50 more pixels along that axis.
Using these in UDim2
Now in UDim2 you must use all the four values, X Scale
,X Offset
,Y Scale
, and Y Offset
. I suggest only using Scale or Offset as if you use both it can get confusing. So unless you have a reason, don't.
Also work isnt defined.