Gui not slowly appearing

The gui is supposed to slowly appear but it does not, no error messages at all.
The code:


script.Parent.Touched:Connect(function(Object)
	local Player = game.Players:GetPlayerFromCharacter(Object.Parent)
	if Player then
		local Dialog = game.Players:GetPlayerFromCharacter(Object.Parent).PlayerGui.Dialog.Dialog
		local Person = game.Players:GetPlayerFromCharacter(Object.Parent).PlayerGui.Dialog.Person
		local gui = game.Players:GetPlayerFromCharacter(Object.Parent).PlayerGui
	if Object.Parent:FindFirstChild("Humanoid") then
		if AlreadyTouched == false then
			AlreadyTouched = true
			wait(2)
			game.Players:GetPlayerFromCharacter(Object.Parent).PlayerGui.Dialog.Dialog.Text = "Are you guys ready for the trip?"
			game.Players:GetPlayerFromCharacter(Object.Parent).PlayerGui.Dialog.Person.Text = "dad"
			game.Players:GetPlayerFromCharacter(Object.Parent).PlayerGui.Dialog.Dialog.Visible = true	
			game.Players:GetPlayerFromCharacter(Object.Parent).PlayerGui.Dialog.Person.Visible = true
			
			wait(4)
			Person.Visible = false
			Dialog.Visible = false
			Person.Text = "Mom"
			Dialog.Text = "Yeah i guess."
				wait(2)
				Person.Visible = true
				Dialog.Visible = true
				wait(4)
				Person.Visible = false
				Dialog.Visible = false
				wait(2)
				Person.Visible = true
				Dialog.Visible = true
			Person.Text = "Dad"
			Dialog.Text = "Oh i didnt notice the taxi, lets go!"
				wait(2)
				Person.Visible = false
				Dialog.Visible = false
				wait(1)
				while gui.BlackScreen.Frame.BackgroundTransparency >= 0 do
					gui.BlackScreen.Frame.BackgroundTransparency = game.StarterGui.BlackScreen.Frame.Transparency - 0.1
					wait (0.1)
				end
			
			
		end
	end
end
end)

					gui.BlackScreen.Frame.BackgroundTransparency = game.StarterGui.BlackScreen.Frame.Transparency - 0.1
					wait (0.1)
				end``` the line

Couple things going on here. First off, inside your loop, that value is not going to change much because you’re referencing the StarterGui’s value, which should be static, and the way you’re going about is is wrong. Instead of using a while loop, you should be using a for loop. So, this is how your code would look instead:

for i = 1,0,-0.1 do
  gui.BlackScreen.Frame.BackgroundTransparency = i
  wait(0.1)
end

It’s also generally advisable to not mess with things like a PlayerGui inside a server-side script as it’s a waste of resources. It should be done in a local script, sending the signal to the local script can be accomplished in various ways but the best method is via remote events.

Try using a tween for it.