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

Why wont this text go transparent?

I made this random script, and I didnt work as i wanted it to. Please help, and thanks!

local Sayings ={
"Hello, welcome back!",
"Have a good day!",
"Thanks for playing!",
"Make sure to give this game a like!",
"Dont forget to favorite this place!",
}


while true do
wait(2)
script.Parent.TextColor3 = Color3.new(math.random(),math.random(), math.random())
for transparency = 0, 1, .1 do
	
end
script.Parent.TextTransparency = transparency
wait(.1)
script.Parent.Text = (Sayings[math.random(1, #Sayings)])
for transparency = 0, -1, -.1 do
	
end
script.Parent.TextTransparency = transparency
wait(.1)
end

1 answer

✓ Accepted answer

You need to put the statements that set the transparency, which in this case they would be:

script.Parent.TextTransparency = transparency

inside of your for loop. If you don't do this, they won't be run each time the for loop iterates.

You should also put:

wait(.1);

inside of the for loops.

Here's your fixed code:

local Sayings ={
"Hello, welcome back!",
"Have a good day!",
"Thanks for playing!",
"Make sure to give this game a like!",
"Dont forget to favorite this place!",
}


while true do
wait(2)
script.Parent.TextColor3 = Color3.new(math.random(),math.random(), math.random())
for transparency = 0, 1, .1 do
script.Parent.TextTransparency = transparency
wait(.1)
end

script.Parent.Text = (Sayings[math.random(1, #Sayings)])
for transparency = 0, -1, -.1 do
script.Parent.TextTransparency = transparency
wait(.1)
end
end


Also, I don't know why you're wrapping: (Sayings[math.random(1, #Sayings)]) in parenthesis.

Sayings[math.random(1, #Sayings)] should work just fine.

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