Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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.

2 comments

0

so u want to know how to slowly change color?

0

Yes, that is my question.

2 answers

✓ Accepted answer

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

2 comments

0

This was basically what I needed, thanks a lot man.

0

Np i got you

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

4 comments

0

In addition remember to make it The frame.Visble to true or false depending on if you want it to appear or not!

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.

0

What colors do you want it to go

0

Black to white

This discussion is preserved as it was. New answers, comments, and votes are closed.