What do you want to achieve?
I would like to have such an effect as in my video.
Button pressed < Frame opens with effect
Close button pressed < Frame closes with effect
What is the issue?
Unfortunately I don’t know how to script tweens.
And, how to make a (in this case a dark) frame that also goes to the very top, where the buttons of the CoreGui are.
Now, I can’t really code it for you because that is considered ‘spooning’ or whatever the term is called. But, if you’d like, I can give you examples of tweening! If you do, I’ll try explaining on how they work.
I know you may not need this, but it’s faster and easier to actually shorten the script. There’s also a couple of things there that aren’t necessary for it to work. I recommend trying something like this in the future.
local btn = script.Parent
local f = script.Parent.Parent:WaitForChild("Frame") -- this allows for the frame to load in
local cbtn = f:WaitForChild("Close")
local o = false -- tells us if the frame is open or closed
btn.MouseButton1Click:Connect(function()
if o == true then
f:TweenPosition(UDim2.new(0.5, 0, 0.5, 0),"Out","Sine",0.3) -- you can add the "DarkBackground" stuff
o = false
else
f:TweenPosition(UDim2.new(0.5, 0, -2, 0),"In","Sine",0.2)
o = true
end)
cbtn.MouseButton1Click:Connect(function()
f:TweenPosition(UDim2.new(0.5, 0, 0.5, 0),"Out","Sine",0.3)
o = false
end)
I think that should be an effective way to make your script shorter. Really, just focus on the “f:TweenPosition…” part as that’s a much easier and faster way to shorten tweening.