I’m making a camera console.
When you Access the camera console, it gives you a cameraGUI, and sets a camera CFrame from a folder, which the different cameras are decided with their index.
Before doing this I tested if i could close this GUI and reopen it. If the script that deletes the GUI is a local script or a script, it can delete the GUI. Although If a localScript is included within the child of the clone, it will not work.
This is the code that gives the GUI to the player
local ProximityPrompt = script.Parent:WaitForChild("PartToProx"):WaitForChild("ProximityPrompt")
local Cards = script.Parent:WaitForChild("Cards")
local CameraGUIFolder = script.Parent:WaitForChild("CameraGUIFolder")
function CheckCard(plr)
for i, v in pairs(Cards:GetChildren()) do
if plr.Character:FindFirstChild(v.Value) then
return true
end
end
end
function InsertCameraSystemUI(Player)
local clone = CameraGUIFolder:Clone()
clone.Parent = Player.PlayerGui
clone.CameraSystemUI.CameraSystemUIScript.Enabled = true
end
local bool = true
ProximityPrompt.Triggered:Connect(function(plr)
if CheckCard(plr) then
if bool == true then
bool = false
if not plr.PlayerGui:FindFirstChild("CameraGUIFolder") then
InsertCameraSystemUI(plr)
end
bool = true
end
end
end)
this is the code that removes it from the player, which is in a textbox from the cloned GUI
local UserInputService = game:GetService("UserInputService")
local function Delete()
script.Parent.Parent.Parent.Parent.Parent:Destroy()
end
script.Parent.MouseButton1Click:Connect(Delete)
If this part is a local script it will not pass the:
if not plr.PlayerGui:FindFirstChild("CameraGUIFolder") then
InsertCameraSystemUI(plr)
end
_
if i try, this, the result is the same
plr.PlayerGui:FindFirstChild("CameraGUIFolder", true)
+ps i also tried to not delete the GUI and just check if it already exists, but i still get the same problem with the findfirstchild not being able to work

