Can you tween and enable something at the same time?

I’m making a menu that enables a blur and tweens a frame on screen.
so far all that happens is the bur enables.
Thanks for reading!!

You could have them in function and execute those functions.

also probably the wrong category

1 Like

Yes, you can enable a BlurEffect instance and tween a frame’s position at the same time, what code are you currently working with?

1 Like

local base = script.Parent.menu
local button = script.Parent
base.Position = UDim2.new(19.846, 0,-7.149, 0)
local entr = game.Lighting.ANs
local open = false

button.MouseButton1Click:Connect(function()

open = not open

local newPos = open and UDim2.new(-19.846, 0,-7.149, 0) or UDim2.new(19.846, 0,-7.149, 0)

local entr = game.Lighting.ANs.Enabled == true or false

base:TweenPosition(newPos, “InOut”, “Quint”, 0.5)

end)

Why do you have open and, and or? Just make newPos equal to UDim2.new(19.846, 0,-7.149, 0)

1 Like

it opens a closes when pressed.

Well, that’s not how you correctly use and and or statements. The and and or statements are used for comparison with a few exceptions. For example if (bar == true and foo == true) will only occur when both bar and foo is equal to true.

local base = script.Parent.menu
local button = script.Parent
base.Position = UDim2.new(19.846, 0,-7.149, 0)
local entr = game.Lighting.ANs
local open = false

button.MouseButton1Click:Connect(function()
   if (open == true) then -- Close
      open = false

      local newPos = UDim2.new(19.846, 0,-7.149, 0) -- I don't know if 19.846 is supposed to be negative or positive

     entr.Enabled == true -- I don't know if this is supposed to be true or false.

      base:TweenPosition(newPos, Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.5)

   else -- Open
      open = true
      local newPos = UDim2.new(-19.846, 0,-7.149, 0)

     entr.Enabled == false

      base:TweenPosition(newPos, Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.5)

   end
end)

1 Like

Thanks After tweaking it a bit It worked!!!