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

How do you check a textlabel's transparency in a local script?

It doesnt seem to update the value at all when I check it in testing but it will appear and never fade away it just goes to delete itself as if transparency 1 = transparency 0. i even tried using a NumberValue to represent the transparency and it didn't update either...

local text = script.Parent

--Fade in.
repeat 
	
text.TextTransparency = text.TextTransparency - .05
wait(.1)
	
until text.TextTransparency <= 0

--Wait a little before fading out.
wait(3)

--Fade out.
repeat 
	
text.TextTransparency = text.TextTransparency + .05
wait(.1)
	
until text.TextTransparency <= 1

--Wait a second before it is destroyed.
wait(1)

text.Parent:Destroy()

1 answer

I suggest using a while loop like this

local text = script.Parent

while text.TextTransparency > 0 do
	text.TextTransparency = text.TextTransparency - .05
	wait(.1)
end

wait(3)

while text.TextTransparency = text.TextTransparency < 1 do
	text.TextTransparency = text.TextTransparency + .05
	wait(.1)
end

1 comment

0

i tried this as well didnt work

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