Help tweening a gui

Hello! I’m trying to make it so when I hit “Y” on my keyboard a Frame named “Phone” will move upward until on the players screen. When they close it, the Frame will move downwards then go invisible. I have the UserInputService script but I just need assistance with the Tween script.


You can connect UserInputService events to a function that tweens the frame.

local TS = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")

local phoneFrame = script.Parent

local myTweenInfo = --insert your tweeninfo here
local goals = {} --insert your Position in UDim2 here

   local myTween = TS:Create(phoneFrame, myTweenInfo, goals)
   print("now the phone slides up smoothly!")

For more information about how to use tweens, refer to Tween and scroll down to bottom for examples. Refer to TweenService for more examples, or if you just wanna learn the API too.

1 Like