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

Screen GUI isn't correctly resized , how to position it correctly ?

Asked by 5 years ago

Hello !

A good friend of mine gave me a ScreenGUI , There is a TextBox and a Button . If something is typed on the TextBox and that we press the button , the text appears for everyone on the screen , I looked into the script I understood it (even if I'm probably the worst at trying to understand scritpts)


function Nameplate() local returnedname = game.Workspace.MainScripts.ReturnName:InvokeServer() script.Parent.Text = returnedname script.Parent.Parent.Visible = true script.Parent.Parent.Position = UDim2.new(0,0,0,0), script.Parent.Parent:TweenSize(UDim2.new(0,0,0,0), "Out", "Quint", 3, true) wait(5) script.Parent.Text = "" script.Parent.Parent:TweenSize(UDim2.new(0,0,0,0),"InOut","Quad",1) wait(1) script.Parent.Parent.Visible = false script.Parent.Parent.Position = UDim2.new(0,0,0,0) script.Parent.Parent.Size = UDim2.new(0,0,0,0) end game.Workspace.MainScripts.Nameplate.Changed:connect(Nameplate)

The Problem is that I just don't know how to resize it correctly , I tried but it always messed up . It's supposed to ''open'' at the middle of the left side , expand to the right side and then after 5 seconds close at the left side again . I tried to place some numbers to see how it works but still weird for me (I'm sure as hell it's easy and I'm going to get slapped lol)

Thanks !

0
You don't know it actually. greatneil80 2647 — 5y

1 answer

Log in to vote
0
Answered by
Miniller 562 Moderation Voter
5 years ago

You actually using TweenSize bad..

script.Parent.Parent:TweenSize(UDim2.new(0,0,0,0), "Out", "Quint", 3, true)

Argument 2 and 3 is not supposed to be a string, read about it.. It should be like this:

script.Parent.Parent:TweenSize(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 3, true)

So that means you actually don't understand it, and don't know what is TweenSize and how to use it. You can read about it here

0
there are two times you use TweenSize, so what I wrote is also same with the second one. Miniller 562 — 5y
Ad

Answer this question