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

Tweening Gui only working in studio?

I dunno why, I was making this little test gui, but it works in studio but doesn't work in the server and it shows no errors.

Button Gui below I've tried local and server scripts for the gui, but it didn't work.

local gui = game.StarterGui.TestGui
local questframe = gui:FindFirstChild("QuestionOneFrame") or gui:WaifForChild("QuestionOneFrame")
local titleframe = gui:FindFirstChild("TitleFrame") or gui:WaitForChild("TitleFrame")
		function Tween()
					titleframe.BeginButton:TweenPosition(UDim2.new(-4, 0,0, 0), "Out", "Quad", 3, false)
					titleframe:TweenPosition(UDim2.new(-4, 0,0, 0), "Out", "Quad", 3, false)
					titleframe.Title:TweenPosition(UDim2.new(0, -1000,0, 0), "Out", "Quad", 3, false)
				questframe.Visible = true
					questframe.Question:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad", 3, false)
															end
				script.Parent.MouseButton1Down:connect(Tween)

No errors in output.

2 answers

You are only manipulating what is inside of StarterGUI, this is not what the player sees. The GUI they see is in PlayerGui, which is where you want to manipulate the GUI.

Simply change up your variables to fit correctly; MAKE SURE THIS IS A LOCAL SCRIPT

Add: local Player = game.Players.LocalPlayer

Change local gui = game.StarterGui.TestGui into: local gui = Player.PlayerGui.TestGui

Finished script is bellow!

local Player = game.Players.LocalPlayer
local gui = Player.PlayerGui.TestGui
local questframe = gui:FindFirstChild("QuestionOneFrame") or gui:WaifForChild("QuestionOneFrame")
local titleframe = gui:FindFirstChild("TitleFrame") or gui:WaitForChild("TitleFrame")
        function Tween()
                    titleframe.BeginButton:TweenPosition(UDim2.new(-4, 0,0, 0), "Out", "Quad", 3, false)
                    titleframe:TweenPosition(UDim2.new(-4, 0,0, 0), "Out", "Quad", 3, false)
                    titleframe.Title:TweenPosition(UDim2.new(0, -1000,0, 0), "Out", "Quad", 3, false)
                questframe.Visible = true
                    questframe.Question:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad", 3, false)
                                                            end
                script.Parent.MouseButton1Down:connect(Tween)


Tweening only works properly in LocalScripts, and not in StarterGui

Move your code to a LocalScript, and get it from PlayerGui instead of StarterGui.

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