I’m currently making a menu UI and I’m having an issue where when I click the button again the same thing will happen, but I want to make it so that Button2 will be active and the other will not, etc.
Code:
local Frame = script.Parent
local Button1 = script.Parent.ImageButton
local Button2 = script.Parent.ImageButton2
local function onButton1Activated()
Frame.AnchorPoint = Vector2.new(0, 0)
Frame.Position = UDim2.new(0, -95, 0.129, 0)
wait(0.7)
Frame:TweenPosition(UDim2.new(0.005, 0, 0.128, 0))
Button1.Visible = false
wait(0.0001)
Button2.Visible = true
end
Button1.Activated:Connect(onButton1Activated)
Button2.Activated:Connect(onButton1Activated)
Video:
If you can see it appears again when Button2 is visible, and I want to make it so it tweens back to the original position without it doing the first tween.