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

How can I make the TweenPosition one way?

Asked by 7 years ago
Edited 7 years ago

So I am currently working on a GUI that involves a lot of TweenPosition and basically I have a script that makes my GUI pop up from the bottom of the screen to the middle of the screen from the click of a button and then if the button is clicked again it will go back down...

here is the script:

local frame = script.Parent.Parent.Parent.Parent:WaitForChild('ShopGUI').Buttons
script.Parent.MouseButton1Click:connect(function()
    if toggle == false then 
        frame:TweenPosition(UDim2.new(0,435,0,800), 'In', 'Back', 0.5)
        toggle = true
    else
        frame:TweenPosition(UDim2.new(0,435,0,220), 'In', 'Back', 0.5)
        toggle = false
    end
end)

So I have this script to toggle a GUI on and off the screen but I want the GUI to just to go off the screen ... but I don't know how to do it... if anybody can help me do this it would be amazing. THANK YOU!!

1
So you want it to scroll down, but no longer scroll up again? Your question is pretty vague. TheeDeathCaster 2368 — 7y
0
So basically I just want the GUI to go down off the screen when I click the button kingwizard13093 5 — 7y
0
Yes, your question is pretty vague and makes no sense. If you want it to go away once something happens, simply add in the Tween to that event like how you have it set up for the MouseButton1Click event. StoIid 364 — 7y
0
From the looks of your code, 'toggle' isn't defined anywhere outside the code; in other words, from my assumption, your indexing 'toggle' as a value, but it's a nil value in this case. TheeDeathCaster 2368 — 7y

Answer this question