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

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

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?

1 comment

0

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

1 answer

✓ Accepted answer

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

2 comments

0

Thank you very much!

0

Np :)

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