--(Here is what I tried coding with I want the project to tween from the bottom of the screen upward and back down separately when clicked multiple times. But only with one button to control this. I am not great at coding so I have tried searching on Youtube and also through peoples creations have yet to get this to work with a single button. Can someone help give me the solution to this? If not it is alright I can just use a two button method I guess.)
function pressed() local ShopFrame = script.Parent.Parent.ShopFrame local toggle = false if not toggle then toggle = true ShopFrame:TweenPosition(UDim2.new(0, 75,1, 10), 'Out', 1) ShopFrame.Visible = false else toggle = false ShopFrame:TweenPosition(UDim2.new(0, 75,0.2, 10), 'Out', 1) ShopFrame.Visible = true end end script.Parent.MouseButton1Down:connect(pressed)
Try this it should work
local Shop = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel local states = {0,1} local selected = 0 script.Parent.MouseButton1Click:Connect(function() selected += 1 local chosenState = (selected%2) print(chosenState) if states[chosenState] == 0 then Shop:TweenPosition( UDim2.new(0.322, 0,0.207, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1, false ) else Shop:TweenPosition( UDim2.new(0.326, 0,0.4, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1, false ) end end)