I’m trying to make a menu that tweens open which works but when pressing again it doesn’t tween close, it just disappears instead of tweening.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Icon = require(ReplicatedStorage.Icon)
local Icon1 = Icon.new()
local PlayerGui = game:GetService("Players").LocalPlayer.PlayerGui
local Panel = PlayerGui:WaitForChild("AdminPanel").Frame.AdminPanel
Panel.Position = UDim2.new(-1, 0, 0.164, 0)
Icon1:setName("Admin Panel"):setImage(6594776225):bindToggleItem(Panel)
Icon1:setLabel("Admin")
Icon1.selected:Connect(function()
Panel:TweenPosition(UDim2.new(0.164, 0, 0.164, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
end)
Icon1.deselected:Connect(function()
Panel:TweenPosition(UDim2.new(-1, 0, 0.164, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
end)