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

Why won't anything happen when I try to tween my GUI?

Here is my script:

Background = script.Parent.Parent


game.Players.PlayerAdded:Connect(function()
	wait(4)
	Background:TweenPosition(UDim2.new({0.346, 0},{0.233, 0}), "Out", "Bounce", "2")
end)

script.Parent.MouseButton1Click:Connect(function()
	Background:TweenPosition(UDim2.new({0.325, 0},{-0.582, 0}), "In", "Bounce", "2")
end)

I have no idea why this won't move from it's position off-screen, to where I want it. I've tried putting a wait at the top of the script so the GUIs would have some time to load. I've tried removing the bottom Tween, nothing. The top tween won't work, and I haven't tested the bottom.

1 comment

0

Remove the PlayerAdded thing - just do the tween instantly. You're not using it correctly.

1 answer

I have no clue why the PlayerAdded is in your script but I'll leave it there regardless

Your problem is you put brackets around each two values in your Udim2 function

It should be more like this

Background = script.Parent.Parent


game.Players.PlayerAdded:Connect(function()
    wait(4)
    Background:TweenPosition(UDim2.new(0.346, 0, 0.233, 0), "Out", "Bounce", "2")
end)

script.Parent.MouseButton1Click:Connect(function()
    Background:TweenPosition(UDim2.new(0.325, 0, -0.582, 0), "In", "Bounce", "2")
end)

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