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

How I tween my menu so that when someone joins the game it bounces out from the bottom to the top?

How do I do this, I started with this, but I don't understand why it'snot working and not doing anything~~~~~~~~~~~~~~~~~

local play = script.Parent.ScreenGui.Play
local store = script.Parent.ScreenGui.Store
local howto = script.Parent.ScreenGui.HowToPlay

if game.Players.PlayerAdded:Connect(function(player)then
	play:TweenPosition(UDim2.new(0.404,0,0.352,0), 'Out', 'Bounce',1)
	store:TweenPosition(UDim2.new(0.403,0,0.485,0), 'Out', 'Bounce',1)
	howto:TweenPosition(UDim2.new(0.402,0,0.618,0), 'Out', 'Bounce',1)
end)end
	play:TweenPosition(UDim2.new(0.404,0,0.352,0), 'Out', 'Bounce',1)
	store:TweenPosition(UDim2.new(0.403,0,0.485,0), 'Out', 'Bounce',1)
	howto:TweenPosition(UDim2.new(0.402,0,0.618,0), 'Out', 'Bounce',1)

end)

1 answer

One of the problems I can see is that you tried to create a function inside of an if ... then statement. This simply will not work.

local play = script.Parent.ScreenGui.Play 
local store = script.Parent.ScreenGui.Store 
local howto = script.Parent.ScreenGui.HowToPlay

game.Players.PlayerAdded:Connect(function(player) --Removed if then statement, because functions do not work like that. This works the same way you intended it to, and an if then statement isn't needed!

wait(5)

play:TweenPosition(UDim2.new(0.404,0,0.352,0), 'Out', 'Bounce',1)

store:TweenPosition(UDim2.new(0.403,0,0.485,0), 'Out', 'Bounce',1)

howto:TweenPosition(UDim2.new(0.402,0,0.618,0), 'Out', 'Bounce',1)

end)

Not sure why you have multiple tweens for each gui so I removed the second copy. Also added a wait so the game can have some time to load before the animations play.

If this worked please accept my answer. If not, let me know what errors you have or if it still doesn't work.

2 comments

0

It still doesn't seem to move

0

is there an error?

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