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

Beginner Scripter: (TWEENING) I need help with this. May you please help me?

Okay so, I need help with this script. I'm trying to figure out whether there's a problem my Tween, I'm very confused. Here, take a look at it:

local playbutton = script.Parent
function OnButtonClick()
	playbutton.MouseButton1Click:Connect(OnButtonClick)
	playbutton:TweenPosition(UDim2(5,0,0,0) "InOut", "Cubic", 1)
end

I don't know what I did wrong. Thank you for your time.

3 comments

0

Line 4: playbutton:TweenPosition(UDim2.new(5,0,0,0),"InOut","Cubic",1) - You forgot the new in the UDim2. UDim2.new().

0

And take line 3 out of the function, and put it after the end, so it's under everything.

0

Okay, thanks.

1 answer

✓ Accepted answer
local playbutton = script.Parent

function OnButtonClick()
    playbutton:TweenPosition(UDim2.new(5,0,0,0) "InOut", "Cubic", 1)
end

playbutton.MouseButton1Click:Connect(OnButtonClick)

Line 4: playbutton:TweenPosition(UDim2.new(5,0,0,0),"InOut","Cubic",1) - You forgot the new in the UDim2. UDim2.new().

Line 3: Take it out of the function, and put it after the end, so it's under everything.


Hope this helped! If this worked for you, let me know by selecting this as the answer!

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