Are you sure you’ve indexed the right thing? ScreenGuis (which should be the direct child of the PlayerGui, or a child of another LayerCollector) don’t have a Visible property.
That’s alright, you should probably do some debugging though. Try adding a print statement, print(PlayerGui:WaitForChild("e"):WaitForChild("LoadingScreen").Visible)
Okay, it might be referencing an old instance. Make sure the ScreenGui’s ResetOnSpawn property is false, and make sure there is no space or anything in the name.
local TweenService = game:GetService("TweenService")
local LoadingRing = script.Parent.LoadingRing
local LoadingText = script.Parent.LoadingText
local LoadingScreen = script.Parent
local Client = game:GetService("Players").LocalPlayer
local PlayerGui = Client.PlayerGui
local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1)
local tween = TweenService:Create(LoadingRing, tweenInfo, {Rotation=360})
local tweenUi = function()
if PlayerGui:WaitForChild('LoadingScreen').Visible then
tween:Play()
end
end
PlayerGui:WaitForChild('LoadingScreen'):GetPropertyChangedSignal('Visible'):Connect(tweenUi)
tweenUi()
LoadingText.Text = "Loading."
wait(1)
LoadingText.Text = "Loading.."
wait(1)
LoadingText.Text = "Loading..."
script.Parent:Destroy()
There is no function being fired if the visibility changes, here I have fixed that error.