New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I make the background of my frame change gradually?

Asked by 3 months ago

I need help changing my backround from black to white gradually, no sudden changes.

if script.Parent.TextTransparency > 0 then
    script.Parent.Visible = false
end

After this line of code is executed, I want to make sure the script detects that the text is invisible so it can start the transition. Anything that needs to be explained hopefully will be.

0
so u want to know how to slowly change color? TheluaBanana 883 — 3mo
0
Yes, that is my question. iiMegabyteGaming 2 — 3mo

2 answers

Log in to vote
0
Answered by
Prestory 1390 Moderation Voter
3 months ago
Edited 3 months ago

Place this inside the frame

for i = 0, 255, 3 do -- Change '3' To Increase/Decrease The Speed
    script.Parent.BackgroundColor3 = Color3.fromRGB(i, i, i)
    wait()
end
0
This was basically what I needed, thanks a lot man. iiMegabyteGaming 2 — 3mo
0
Np i got you Prestory 1390 — 3mo
Ad
Log in to vote
0
Answered by 3 months ago

There are many ways to do this, a common (and best way in my opinion) are loops! There are three main loops: repeat until, While True Do, and for.

The Code Below Demonstrates two types of loops In action with your frame below!

while script.Parent.TextTransparency > 0 then
    wait(0.1) -- Change to how fast you want to increase transparency
    script.Parent.TextTransparency = script.Parent.TextTransparency  + 0.01 -- the higher / lower this is the more time it will take to fade. the higher it is the more spikey, the less it is the more smooth! I reccomend these settings
end

repeat 
    wait(0.1) -- Change to how fast you want to increase transparency
    script.Parent.TextTransparency = script.Parent.TextTransparency  + 0.01 -- the higher / lower this is the more time it will take to fade. the higher it is the more spikey, the less it is the more smooth! I reccomend these settings
until script.Parent.TextTransparency = 1

-- if you want to make the object to appear and not dissapear, remove the + signs and change them to minus.

I hope this helped, If not please respond why and I'll try to check later

Sincerely, lolmarkdude2
0
In addition remember to make it The frame.Visble to true or false depending on if you want it to appear or not! MarkHasReset 76 — 3mo
0
The problem isn't the text not going transparent, it's that I don't know how to format an gradual change to the background's color. It appears (r,g,b) doesn't work, and I doubt "r,g,b" works as well. iiMegabyteGaming 2 — 3mo
0
What colors do you want it to go Prestory 1390 — 3mo
0
Black to white iiMegabyteGaming 2 — 3mo

Answer this question