Camera script is not working

I have a script in PlayerGui that’s supposed to set the player’s camera for the main menu, but it doesn’t work and doesn’t print any errors or just anything (printing doesn’t work either) I’ve tried adding wait(), it only works in StarterPlayerScripts for some reason, but I don’t want it there

local Camera = workspace.CurrentCamera

repeat wait()
	Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.MenuCam.CFrame

remove that repeat loop, just put the Camera.CameraType = Enum.CameraType.Scriptable instead

im not quite sure what this means, can you explain?

just try fr
(character limit 30)