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

Attempt to call a userdata value,what does that mean?

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

3 comments

0

Hmm let me edit, k

0

ok

0

Thanks for trying!

2 answers

✓ Accepted answer

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)

6 comments

0

@18 can you please tell my mistake e.e.

0

I was editing then someone put -1, but never got to finish....

0

I have already shown the problem. Your problem was that you were trying to give TweenSize two unneeded strings and, most of all, you didn't notice the real mistake: it was trying to call a userdata as a function.

0

So the comma? I edited that when I got negative 1.

0

It must've been someone noticed that your previous answer was incorrect before you edited, and they chose to downvote the answer. The worst thing to do in this situation is to make it the focus. Just ignore it and you'll be fine.

0

Thanks for the advice :)

 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 :)!

2 comments

0

It still got the same error. :C

0

Well it is more beneficial as the wiki article mentioned a bunch of benefits from it.

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