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 userdata value?

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 comment

1

'script.Parent.TextButton' are you sure that's where TextButton is?

1 answer

✓ Accepted answer

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)

1 comment

0

I did realize that after rewriting the code.

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