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

Attempt to call userdata value?

Asked by 7 years ago

Any idea why my Button wont animate off the screen?

script.Parent.TextButton.MouseButton1Click:connect(function()
    script.Parent.TextButton:TweenPosition(UDim2.new(2,0,.75,0)"Out","Quad",1,false,nil)
end)

Error:

00:52:45.912 - Players.dotProgram.PlayerGui.ScreenGui.Load.LocalScript:2: attempt to call a userdata value
1
'script.Parent.TextButton' are you sure that's where TextButton is? UniversalDreams 205 — 7y

1 answer

Log in to vote
2
Answered by 7 years ago

This will be due to the missing comma between UDim2.new(2,0,.75,0) and "Out","Quad",1,false,nil. Here's the fixed code:

script.Parent.TextButton.MouseButton1Click:connect(function()
    script.Parent.TextButton:TweenPosition(UDim2.new(2,0,.75,0),"Out","Quad",1,false,nil)
end)
0
I did realize that after rewriting the code. dotProgram 0 — 7y
Ad

Answer this question