Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

what is this gui tween thing and how do I do this?

Asked by
zValerian 108
4 years ago

So I see this in a bunch of games and I was wondering how do I do it. I am trying to make the gui pop out of nowhere and tween in but I don't even know what it's called. It looks like this:

https://gyazo.com/999cc9f34bdd77b57f2bee1d762be9dd

see like how the gui pops out of nowhere and leaves nowhere

2 answers

Log in to vote
0
Answered by
sheepposu 561 Moderation Voter
4 years ago
Edited 4 years ago

Here is an example of making a Gui slide from above. The GUI object's current position is (0.2, 0, -1, 0) Then if I do this it will slide down

local guiObject = --Get GUI Object

guiOBject:TweenPosition(UDim2.new(0, 2, 0, 0.2, 0), 'Out', 'Quint') --There are also other customizations to this TweenPosition

Go here for more info - https://developer.roblox.com/en-us/api-reference/function/GuiObject/TweenPosition

0
Oops I guess I didnt refresh it to find out if someone else answered D: guywithapoo 81 — 4y
0
It's fine, now he/she has two answer they can learn from sheepposu 561 — 4y
0
sheepposu you need to add a number at the end EX: (UDim2.new(0, 2, 0, 0.2, 0), 'Out', 'Quint', ANumberHere) NeptyU 15 — 4y
0
No, I do it without the number. The default is already 1 sheepposu 561 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

I made something exactly like this a while back. I just copy and pasted the script that I created, so maybe you can break it down to figure it out? Here it is:

local Menu = script.Parent.Parent:WaitForChild("Menu")
local open = game.StarterGui.MenuGUI.Menu.Open.Value
local Codes = script.Parent.Parent:WaitForChild("CodesMenu")
local CashMenu = script.Parent.Parent:WaitForChild("CashMenu")
local CashItems = script.Parent.Parent:WaitForChild("CashItems")
local ShopMenu = script.Parent.Parent:WaitForChild("ShopMenu")
local Particles = script.Parent.Parent:WaitForChild("Particles")
local Items = script.Parent.Parent:WaitForChild("Items")
enabled = true
script.Parent.MouseButton1Click:connect(function()
    if enabled == true then
        enabled = false
    if open == false then
        Menu:TweenPosition(UDim2.new(0, 0,0, 300),"Out","Quint", 0.5)
        open = true 
        script.Parent.Text = "Menu"
    elseif open == true then 
        Menu:TweenPosition(UDim2.new(-1, 0,0, 300),"In","Quint", 0.5)
                Codes:TweenPosition(UDim2.new(1.272, 0,0.203, 0),"In","Quint", 0.5)
                        CashMenu:TweenPosition(UDim2.new(1.272, 0,0.203, 0),"In","Quint", 0.5)
                                CashItems:TweenPosition(UDim2.new(1.272, 0,0.203, 0),"In","Quint", 0.5)
                                        ShopMenu:TweenPosition(UDim2.new(1.272, 0,0.203, 0),"In","Quint", 0.5)
                                        Items.Visible = false
                                        Particles.Visible = false
                                        ShopMenu.Particles.Text = "Particles"
                                        ShopMenu.Power.Text = "Power Ups"

        open = false
        script.Parent.Text = "Menu"
    end
    end
    wait(1)
enabled = true
end)

Sorry if it looks kind of messy, I'm not a very good scripter yet. I hope you can get something from this though!

Answer this question