Hello. My script is slow!
01 | q = true |
02 | script.Parent.MouseButton 1 Click:connect( function () |
03 | if q then |
04 | q = false |
05 |
06 | for i = 50 , 250 , 0.1 do game:GetService( "RunService" ).RenderStepped:wait() |
07 | script.Parent.Parent.Position = UDim 2. new( 1 , -(i), 0 , 500 ) |
08 | end |
09 |
10 | q = true |
11 | end |
12 | end ) |
It`s at a rate of 30/s
It`s made for making an animation...
I`ll upload the .gif later.
It would be much simpler to use the TweenPosition
method on the GUI. Like this:
1 | script.Parent.Parent:TweenPosition( |
2 | UDim 2. new( 1 , - 250 , 0 , 500 ), --Replace this with where you want the GUI to be |
3 | "Out" , --Replace this with the direction of the tween |
4 | "Linear" , --Replace this with the style of the tween |
5 | 10 --Replace this with the duration of the tween |
6 | ) |
It's much easier! Hope this helped!
Note: For more information on TweenPosition, click here: TweenPosition
Put a Wait()
. I'm sure it'll help.