Hi, I’ve been having trouble having the camera turn off after you press play when you’re in the main menu, any suggestions or fixes? Tried for about 45 minutes, same situation is happening. OOF, thanks.
-- Variables --
local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local mainFrame = script.Parent
-- Camera --
repeat wait() until mainFrame.Visible == false
camera.CameraType = "Scriptable"
camera.CFrame = game.Workspace.CamPart.CFrame
This is a syntax error. There needs to be an expression after the until. This is the condition that needs to be met for the loop to break. Do specify information like this next time.
The code is fundamentally flawed. Simply setting mainFrame.Visible = false is enough.
To implement it in your code:
-- Variables --
local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local mainFrame = script.Parent
local pressPlayGui = -- find it in your explorer or make it
-- Camera --
pressPlayGui.MouseButton1Down:Connect(function()
mainFrame.Visible = false
camera.CameraType = "Scriptable"
camera.CFrame = game.Workspace.CamPart.CFrame
end)