I got a error on line 21 saying Workspace.Part.SurfaceGui.Start.Script:21: attempt to call a userdata value
What does it mean?
part = script.Parent frame = script.Parent.Parent.Frame clicked = false part.MouseButton1Click:connect(function() ---------------Debounce------------------ if clicked == false--Checks if clicked is false(Which it should be,because it already been set false) then clicked = true-- Since it false it will turn it true(so we know it's already been clicked) ----------------Fade Out------------------ for fo = 0,10 do wait(0.1) part.BackgroundTransparency = fo/10--You need to divide to get the precise number(Other way won't work) part.TextTransparency = fo/10 if fo/10 ==1 then part.Visible = false clicked = false --Turns it false,so it you won't able to click it. frame.Visible = true --------------The frame-------------------- frame:TweenSize(UDim2.new(0, 0,0, 500)"Out","Quad","1","false") end end end end)
edited line 21
Your problem is that lua thinks you're trying to call something that's not a function.
UDim2.new(0, 0,0, 500)"Out"
That is valid syntax. Functions can be called without parentheses in some situations. If you put a function name, then a string, you will call the function with only that string.
The real problem, though, is you forgot a comma! If you add a comma between the UDim2 and "Out" your script should run fine (as long as you also change the "1"
and "false"
back to how they were, a number and a boolean).
frame:TweenSize(UDim2.new(0, 0,0, 500),"Out","Quad",1,false)
frame:TweenSize(UDim2.new(0, 0,0, 500),"Out","Quad",1,false)
You can try this and try it, though it should work.
Using the 1 and dis-including the false or true statement will throw an error of comparing to user data. Also the nil.
**USE LOCALSCRIPT**
Also TWEEN TUTORIAL
+1 if helped, and if it answered your question, answered question mark :)!