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

How do you tween a text button when a button is clicked?

I would like the text button and a frame to stay on the scene until the button is clicked then I would like to have the button tweened off the scene. Like a play button to a new game.

(Im very new to Lua coding)

This is the code I have:

local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local button = playerGui.PlayScrene.Screne.Play
local PlayButton = playerGui.PlayScrene.Screne.Play
local object =playerGui.PlayScrene.Screne
local click = game.Workspace.Click

object.Position = UDim2.new(0, -object.Size.X.Offset, 2, 0)

button.MouseButton1Click:connect(function()
    object:TweenPosition(UDim2.new(-0.35, 0,0.35, 0))
end)

I realize that some stuff may be misspelled

Thanks

1 answer

✓ Accepted answer

when writing the...

object:TweenPosition(UDim2.new(-0.35, 0,0.35, 0))

you forgot the numbers at the end, So it would look like this

object:TweenPosition(UDim2.new(-0.35, 0,0.35, 0),1,1,1,1)

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