How do I remove a folder from StarterGui for just the client?

What I know

I know about the PlayerGui Folder but I need to make sure the Folder stays gone unless the person Enables it.

Achieve

I’m attempting to achieve a way to enable and disable cutscenes by deleting a folder of where the Cutscenes go for just the Local Player.

The Issue

No matter what I do, it removes the Cutscenes Folder for both the entire game StarterGui and the PlayerGui.

Solutions

I’ve tried going off of who fires the Event but that tends to remove it for everyone no matter what I do.

The Script

--Made By MillerrIAm
-------------Variables------------
Event = game.ReplicatedStorage.ExtraEvents.CutsceneAllowance
------------Main Script------------
Event.OnServerEvent:Connect(function(plr,Checking)
	if Checking == "True" then
		local startergui = game.StarterGui
		if startergui:FindFirstChild("Cutscenes") then
			startergui.Cutscenes:Destroy()
			plr.PlayerGui.Cutscenes:Destroy()
		elseif not startergui:FindFirstChild("Cutscenes") then
			local Folder1 = Instance.new("Folder")
			Folder1.Name = "Cutscenes"
			Folder1.Parent = startergui
			local Folder2 = Instance.new("Folder")
			Folder2.Name = "Cutscenes"
			Folder2.Parent = plr.PlayerGui
		end
	end
end)

Thank you for any help you can provide.

1 Like

You literally told it to do this in the startergui.

Change that to this:

	local playergui = plr.PlayerGui
		if playergui:FindFirstChild("Cutscenes") then
			plr.PlayerGui.Cutscenes:Destroy()
		elseif not playergui:FindFirstChild("Cutscenes") then

And completely delete this part:

Whenever someone joins the game, everything in the startergui is cloned and put in their playergui, the player can only see and interact with stuff in their playergui.

Okay so, I understand my error but I need the folder to stay removed when the person respawns.

In a local script destroy the gui in startergui. I don’t know if This will work, so let me know if it does.

Maannn, I totally didn’t forget about this post at all…

ANNYWAYYY;
Yes! This did work, I simply put a folder inside a ScreenGui and made it so the UI didn’t reset on respawn. Thank you for the help!