Help Making a Manually Sliding Gui

Hey! So I wanted to be able to make a gui, one that can slide but manually just like the one in the video below. I wanted to use it for advertising purposes and wanted to be able to display the ads using that method.

So the issue is, I don’t even know where to start other than I have to use TweenService and I am not very good at using that in scripting. Also no matter how much I searched, there are no tutorial videos on how to do so.

I know it is possible because I have seen it in a game, but the part that sucks is I forgot the name of the game… If anyone can provide help on this it will be appreciated :smiley:

1 Like

I’m not too sure if this will work but you can try this:

In the buttons on the side, the arrows to slide the screen, you put a Local Script inside each.

Then, for the Frame to move you could try this inside the button:

local Frame = yourFrameHere
local button = script.Parent

button.MouseButton1Click:Connect(function()
     Frame:TweenPosition(UDim2.new(positionHere), 2)
     print("TweenSuccess") -- this just helps to know it works
end)

The 2 at the end represents the time it takes for the Frame to move.

Now, for having the other second frame slide in, it might be a case of perfect timing and trial and errors.

So to add the second frame, you could add this to the script:

local Frame = yourFrameHere
local button = script.Parent
local SecondFrame = secondFrameHere

button.MouseButton1Click:Connect(function()
     Frame:TweenPosition(UDim2.new(positionHere), 2)
     print("TweenSuccess") -- this just helps to know it works
     wait(1) -- the time it takes for the second one to move
     SecondFrame:TweenPosition(UDim2.new(positionHere), 2) -- times it takes for it to move
     print("SecondTweenSuccess")
end)

This is just a basic version, and may need a lot of time to get all the positions right.

Also, for the first frames position, that would be the position that the first frame will go to, which would be off the screen. And the second frames position will be the centre of the screen, or wherever you want it to be.

Hope this helps. Feel free to ask any questions!

1 Like

Okay, Thanks so much! it works!

1 Like