1 | local gui = script.Parent.Parent:WaitForChild( "TextLabel" ) |
2 |
3 | wait( 3 ) |
4 |
5 | function startgui() |
6 | script.Parent.Position = UDim 2. new( 0.425 , 0 , 0.3 , 0 ) |
7 | end |
8 |
9 | print ( "Okay?" ) |
I don't understand whats wrong. It prints the "Okay?" and it's not giving me any errors, but the gui wont move to the desired location.
Thanks.
local gui=script.Parent.Parent:WaitForChild("TextLabel")
wait(3)
function startgui() script.Parent.Position = UDim2.new(0.425,0,0.3,0) end
startgui() --Needing to call the function like the other said too. print("Okay?")
You need to reference things properly in a Gui.
Here is what the script should look like:
01 | local players = game:GetService( "Players" ) |
02 | local player = players.LocalPlayer |
03 |
04 | local playerGui = player:WaitForChild( "PlayerGui" ) |
05 | local screengui = playerGui:WaitForChild( "NameHere" ) |
06 | local gui = screengui:WaitForChild( "TextLabel" ) |
07 |
08 | local frame = script.Parent |
09 | -- Or wherever you put the script, and text label |
10 |
11 | -- First of all you never referenced back to the function you did! |
12 | -- Secondly you don't need a function to run this. Without a function it will run automatically. |
13 |
14 | frame:TweenPosition(UDim 2. new( 0.425 , 0 , 0.3 , 0 ), "In" , "Quint" , 1 ) |
15 | wait( 0.5 ) |
16 | print ( "FIXED!" ) |
This is your new and improved script that should work to move the Gui!