Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 10 years ago

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

0
Hmm let me edit, k HexC3D 830 — 10y
0
ok kevinnight45 550 — 10y
0
Thanks for trying! kevinnight45 550 — 10y

2 answers

Log in to vote
2
Answered by
User#2 0
10 years ago

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)
0
@18 can you please tell my mistake e.e. HexC3D 830 — 10y
0
I was editing then someone put -1, but never got to finish.... HexC3D 830 — 10y
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. User#2 0 — 10y
0
So the comma? I edited that when I got negative 1. HexC3D 830 — 10y
View all comments (2 more)
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. User#2 0 — 10y
0
Thanks for the advice :) HexC3D 830 — 10y
Ad
Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
 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 :)!

0
It still got the same error. :C kevinnight45 550 — 10y
0
Well it is more beneficial as the wiki article mentioned a bunch of benefits from it. HexC3D 830 — 10y

Answer this question