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

My Tweening gui is giving me an annoying error and i don't know whats wrong?

OK so i'm watching a tutorial on Gui Tweening and here is my code

``local GUI = script.Parent.Frame local OpenAdmin = script.Parent.AdminButton

OpenAdmin.MouseButton1Up:Connect(function() --open admin--

GUI:TweenPosition(
UDim2.new(0.288, 0, 0.1, 0) 

"Out"
"Bounce"

1,
false
nil
)

end)

The error i keep getting is Players.EyeDontLie.PlayerGui.AdminGUI.LocalScript:14: Expected ')' (to close '(' at line 8), got '1'

I don't know what is wrong since it worked for the youtuber.

1 answer

You forgot to add a few '(' and ')'

local GUI = script.Parent.Frame 
local OpenAdmin = script.Parent.AdminButton

OpenAdmin.MouseButton1Up:Connect(function() --open admin--
GUI:TweenPosition(UDim2.new(0.288, 0, 0.1, 0) ,"Out","Bounce",1,false,nil) [[-- You forgot to add commas here and forgot to close the bracket--]]

end) -- Add an ')' after an end if it is corresponding to a function starting with '('. 

Should Work. Always add an ')' after 'end' if your function starts with '('. For Example:

script.Parent.Touched:Connect(function() -- Function starts with '('

end) -- Therefore this should end with ')'

Hopefully this helped! Mark it as an answer if it did pls!

Thank you

Also here is a tip! Always make sure to check the output and detect where you are going wrong:

Players.EyeDontLie.PlayerGui.AdminGUI.LocalScript [[-- This is where the error is located --]]:14[[--This is the line where it go the error--]]: Expected ')' (to close '(' at line 8), got '1' -- The issue

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