Idk should work.
local Frame = script.Parent
local function Fade()
for i = 1,10 do
Frame.BackgroundTransparency = Frame.BackgroundTransparency + 0.1
wait(0.1)
end
end
Idk should work.
local Frame = script.Parent
local function Fade()
for i = 1,10 do
Frame.BackgroundTransparency = Frame.BackgroundTransparency + 0.1
wait(0.1)
end
end
So, you want the frame to fade when pressing a button right?
well in all honestly, i dont know how it would work or how it would but im trying to make the buttons fade and not work so i can have a new gui and exit button
So, you want the button to fade out and have a new button fade in when clicked. Is that correct?
yes that correct, my idea was for it to all fade out that faded background stays and a scrolling gui with buttons and an exit button
Ok, I see now. That isn’t too hard to do actually. So, first, you want to fade out the background for the button:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.BackgroundTransparency = 0.1
wait()
script.Parent.BackgroundTransparency = 0.2
wait()
script.Parent.BackgroundTransparency = 0.3
wait()
script.Parent.BackgroundTransparency = 0.4
wait()
script.Parent.BackgroundTransparency = 0.5
wait()
script.Parent.BackgroundTransparency = 0.6
wait()
script.Parent.BackgroundTransparency = 0.7
wait()
script.Parent.BackgroundTransparency = 0.8
wait()
script.Parent.BackgroundTransparency = 0.9
wait()
script.Parent.BackgroundTransparency = 1
end
Then you want to fade out the text transparency. This can be a separate script if you want:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.TextTransparency = 0.1
wait()
script.Parent.TextTransparency = 0.2
wait()
script.Parent.TextTransparency = 0.3
wait()
script.Parent.TextTransparency = 0.4
wait()
script.Parent.TextTransparency = 0.5
wait()
script.Parent.TextTransparency = 0.6
wait()
script.Parent.TextTransparency = 0.7
wait()
script.Parent.TextTransparency = 0.8
wait()
script.Parent.TextTransparency = 0.9
wait()
script.Parent.TextTransparency = 1
end
Then I recommend for the other button, you make a varible out of it and do the exact samething I wrote but make it fade in.
Quick thing I noticed.
Right now, your checking constant has the game loaded. The better solution would be to check, and if it’s not loaded wait for it to be loaded.
if not game:IsLoaded() the
game.Loaded:Wait()
end
forgive the formatting, I’m on mobile.
Also, if you save the tween to a variable and call that to play it, you would be able to listen to a .Completed event for more accurate timing.
oh im sorry i must have concussed you lol i do apologize for that inconvenience i meant the buttons go but this image label stays
Then just make make that function I made for you but just assign the function to the other buttons besides the image label.
I’d reccomend looking into tween service ri replace constantly wait() then set transparency, as tweenservice gusrantees a smooth transition.
I could use that in the future. I’m just use to that method.
I highly reccomend you use tweenservice over that. It’s smooth, much easier to setup, and looks better.
is there a way to link it to other buttons and labels? also yes thanks for recommending!
The way that I think you can do is just to make separate functions for each element.
I think what you should do is define a book value inside one of the frames, and whenever one button is clicked change the value to false so any of the tweens tween I’ve buttons stop and don’t break anything. From there, you should be able to just tween the three text transparencies.
Do you mean a bool value for what you are trying to say?
Since it’s all on different scripts, you would do that to store if one of the three has been pressed inside of a bool value instance, so you would be able to check for that and not highlight the other buttons when you hover over them.
wow that makes sense! but how would i even begin to format it? it seems like i really big thing for a beginner scripter to try and start doing
Take a look at the TweenService api and try to make it fit with your situation. If it doesn’t work, send us your script.
Loop your ui elements to a generic for loop that fades them out with tween then make sure to use tween:Wait() then fade in with tween by changing their transparency. If you mean like fade to black make a black ui become visible and fade in then when fully done make all the menu ui not visible