Transparency

There are 2 kinds of transparency in ROBLOX Studio. There are part transparency and GUI transparency. Part and GUI transparency can both easily be changed from the properties. If you want to use scripts, I would suggest using server scripts for parts and local scripts for GUIs. You can easily adjust transparency for both like this:

Part: 

task.wait(1)

script.Parent.Transparency = 0.5

task.wait(1)

script.Parent.Transparency = 1

If you want to use it with if and then in another script:

if script.Parent.Transparency == 0.5 then

      local x += 1

 

      game.ReplicatedStorage.NumberValue.Value = x

      print("value added!")

end

This will add 1 to the value of the NumberValue in ReplicatedStorage. The 2 scripts will work together to meet the requirement. If the value was added, the game should print "value added!" in the output.

GUI:

script.Parent.BackgroundTransparency = 0.8

task.wait(0.5)

script.Parent.BackgroundTransparency = 0.6

task.wait(0.5)

script.Parent.BackgroundTransparency = 0.4

task.wait(0.5)

script.Parent.BackgroundTransparency = 0.2

task.wait(0.5)

script.Parent.BackgroundTransparency = 0

If you want everything to be invisible including the text:

script.Parent.Parent.Enabled = false or script.Parent.Visible = false

If you want to use if and then in another script:

if script.Parent.BackgroundTransparency == 0 then

      game.Players.LocalPlayer:Kick("the end.")

      print("player shown ending successfully")

end

This will kick the player from the game to tell them it's the end of it. If the script worked successfully, the game will print "player shown ending successfully" in the output.