In my game there is a little menubutton on the left hand side of the screen, I want the menu button kinda tucked away but when a user puts his mouse over it it will slide out and show the full button and when he removes his mouse it will slide back. Basically when you put the mouse over it right now it just keeps sliding and will keep sliding every time you put your mouse over it until it goes off screen (also it wont go back because I have no clue how to add that) All I need is it to stop at a certain point (doesn't matter where you put it just point out that's what it is) and go back after removing the mouse for about 3 seconds.
Here is the code I have so far (this only includes the sliding forwards, I have no clue what I'll do about sliding back)
Menu = script.Parent
MenuButton = Menu.MenuButton
MenuPos = MenuButton.Position
MenuX = MenuPos.X.Scale
print("Pos of menuX is " .. MenuX)
if MenuX <= 0.5 then
function OverMenuButton()
for MenuPosition = 1, 20 do
if MenuPosition <= 20 then
MenuButton.Position = MenuButton.Position +UDim2.new(0.01, 0, 0, 0)
end
wait()
end
end
end
MenuButton.MouseEnter:connect(OverMenuButton)
If you guys could help, and give wiki links that would be great!

1 comment
I have never used this before, so I can't really teach it, but try this: http://wiki.roblox.com/index.php?title=Tweening