Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make SurfaceGUI/GUI tween, longer for a specific time?

Asked by
Lualaxy 78
6 years ago

So I made a tween size script for my simple SurfaceGui animation. My question is how do I make the tween size function run for a specific time so I decide when the gui part will reach my prefered tween possition?

My code:

local Frame = script.Parent.Frame
local StartButton = script.Parent.Frame.Start
local GUIBar = script.Parent.Frame.ProgressBar

function OnClicked()
    StartButton.TextScaled = true
    StartButton.Text = "In progress..."

    GUIBar.Size = UDim2.new (0, 0,0, 50)
    GUIBar:TweenSize(UDim2.new (0, 600,0, 50))

end

StartButton.MouseButton1Click:connect(OnClicked)

What do I need to do here?

0
GUIBar.Size = UDim2.new (0, 0,0, 50), "Out", "Quad", SECONDS) Put seconds of how long you want the gui to tween hellmatic 1523 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You just have to add some things after the Udim2

GUI:TweenPosition(UDim2.new(1, 0, 1, 0), "Out", "Quad", 3) The last 3 would be the time, the things before the 3 are neccesary! (you can change them though)

(This is the same for tweensize)

Click here for the wiki

0
Thank you very much! Lualaxy 78 — 6y
0
Np :) User#20388 0 — 6y
Ad

Answer this question