So I'm making a game and I'm trying to get this text label to fade in, then fade out, the text will change, and then fade back in with different text, and finally, the script will be deleted once it is all over. (This is in a local script) everything seems to be working, there are no developer console warnings, but the text just stays transparent. I've tried using the print function to verify if it goes all the way through, and it does.
startingd = Instance.new("TextLabel", game.StarterGui.d1gui) --[[d1gui is the name of the screen gui in startergui]]--
startingd.Name = "Dialog1"
startingd.BackgroundTransparency = 1
startingd.Position = UDim2.new(0.313, 0, 0.918, 0)
startingd.Size = UDim2.new(0, 717, 0, 63)
startingd.Font = "Fantasy"
startingd.TextSize = "Size30"
startingd.Text = "Finally, I've made it to the checkpoint."
startingd.TextTransparency = 1
startingd.TextColor3 = Color3.new(255, 255, 255)
wait(2)
for dtexttrans = 1, 0, -.1 do
startingd.TextTransparency = dtexttrans
print("It is working!")
wait(.05)
end
wait(5)
for dtextfade = 0, 1, .1 do
startingd.TextTransparency = dtextfade
print("It is working, again!")
wait(.01)
end
wait(2)
startingd.Text = "I should keep going, no point in standing out in the rain."
for dtexttrans2 = 1, 0, -.1 do
startingd.TextTransparency = dtexttrans2
wait(.01)
end
wait(6)
for dtextfade2 = 0, 1, .1 do
startingd.TextTransparency = dtextfade2
wait(.01)
end
print("Goodbye cruel world :'(")
game.StarterGui.d1gui.Dialog1:Destroy()
wait(.01)
If I instead try to reverse it and have it be visible at the start, the values dont change and it stays visible. I can't seem to figure out the issue, and I am new to scripting.

3 comments
on line 2 for some reason in this it is labeled as being text, it isnt like that in roblox script editor.
https://scriptinghelpers.org/blog/common-mistakes#PlayerGui
Also, for line 7, it takes a number, not a string.