Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by
Knqe 23
4 years ago

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
0
i tried this as well didnt work ReallyUnikatni 68 — 4y
Ad

Answer this question