Local script in replicated first isn't able to change PGui's set

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want the script to disable the screen gui.

  2. What is the issue?
    The issue is, it just doesn’t seem to be able to do this. I’m really unsure what’s going on…

  3. What solutions have you tried so far?
    I’ve tried a remote event, so the server changes it and tried placing the script in different places. None have worked

--VenTech

-- Services
local TweenService = game:GetService("TweenService")
local RepFirst = game:GetService("ReplicatedFirst")
local Players = game:GetService("Players")
local SS = game:GetService("SoundService")
local RS = game:GetService("ReplicatedStorage")

--Variables/Constants
local Player = Players.LocalPlayer
local PGui = Player:WaitForChild("PlayerGui")
local LoadCam = RS:WaitForChild("LoadingInEvent")

local SGui = script.LoadingScreen:Clone()
SGui.Parent = PGui

RepFirst:RemoveDefaultLoadingScreen()
LoadCam:FireServer("Startup")

while true do
	SGui.Frame.LoadingTxt.Text = "Loading your experience..."
	wait(0.5)
	SGui.Frame.LoadingTxt.Text = "Loading your experience.."
	wait(0.5)
	SGui.Frame.LoadingTxt.Text = "Loading your experience."
	wait(0.5)
	if game:IsLoaded() and game.Workspace:FindFirstChild("LoadingCameraPart") then
		break
	end
end

local WorkspaceCam = game.Workspace:WaitForChild("Camera")

WorkspaceCam.CameraType = Enum.CameraType.Fixed
WorkspaceCam.Focus = game.Workspace:WaitForChild("LoadingCameraPart").CFrame
SGui.Frame.LoadingTxt.Text = "Game loaded! Click play to begin."
SGui.Frame.Play.Visible = true
SGui.Sound:Play()
TweenService:Create(SGui.Frame, TweenInfo.new(1.5), {Transparency = 0.1}):Play()
for i = 1,5 do
	SGui.Sound.Volume = SGui.Sound.Volume + 0.1
	wait(0.3)
end

SGui.Frame.Play.MouseButton1Click:Connect(function()
	local tween1 = TweenService:Create(SGui.Frame, TweenInfo.new(1.5), {Transparency = 1})
	for i, v in pairs(SGui.Frame:GetChildren()) do
		TweenService:Create(v, TweenInfo.new(1), {Transparency = 1}):Play()
	end
	tween1:Play()
	for i = 1,5 do
		SGui.Sound.Volume = SGui.Sound.Volume - 0.1
		wait(0.3)
	end
	WorkspaceCam.CameraType = Enum.CameraType.Custom
	WorkspaceCam.CameraSubject = Player.Character.Humanoid
	tween1.Completed:wait()
	SGui.Parent.LoadingScreen.Enabled = false -- THIS IS WHAT ISNT WORKING
	SGui.Sound:Stop()
end)

image
This is it in ReplicatedFirst, it’s a loading screen which I want to disable after it’s finished. It confuses me as to why it’s not working. There don’t seem to be any errors either…