local gui=script.Parent.Parent:WaitForChild("TextLabel") wait(3) function startgui() script.Parent.Position = UDim2.new(0.425,0,0.3,0) end 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:
local players = game:GetService("Players") local player = players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local screengui = playerGui:WaitForChild("NameHere") local gui= screengui:WaitForChild("TextLabel") local frame = script.Parent -- Or wherever you put the script, and text label -- First of all you never referenced back to the function you did! -- Secondly you don't need a function to run this. Without a function it will run automatically. frame:TweenPosition(UDim2.new(0.425,0,0.3,0), "In", "Quint", 1) wait(0.5) print("FIXED!")
This is your new and improved script that should work to move the Gui!