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

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

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 !

1 comment

0

You don't know it actually.

1 answer

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

1 comment

0

there are two times you use TweenSize, so what I wrote is also same with the second one.

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