Basically, im trying to make a camera system with multiplie cameras, but i can only switch to them once but i want to be able to switch to them as many times as i want, heres a video, https://streamable.com/uq7uks.
Here are the directories and the code of scripts:
Note: "CamButtons" is a frame
Camera 1 button directory: StarterGui\ScreenGui\CamButtons\Cam 1 Camera 1 local script StarterGui\ScreenGui\CamButtons\Cam 1\cam1script Camera 1 local script code:
local Enabled = false script.Parent.MouseButton1Click:Connect(function() if not Enabled then Enabled = true game.Players.LocalPlayer.Backpack.Camera1.Disabled = false game.Players.LocalPlayer.Backpack.Camera2.Disabled = true end end)
Camera 2 button directory: StarterGui\ScreenGui\CamButtons\Cam 2 Camera 2 local script StarterGui\ScreenGui\CamButtons\Cam 2\cam2script Camera 2 local script code:
local Enabled = false script.Parent.MouseButton1Click:Connect(function() if not Enabled then Enabled = true game.Players.LocalPlayer.Backpack.Camera1.Disabled = true game.Players.LocalPlayer.Backpack.Camera2.Disabled = false end end)
The open camera GUI / main button directory: StarterGui\ScreenGui\maincambutt The open camera GUI / main button local script: StarterGui\ScreenGui\maincambutt\camscript The open camera GUI / main button code:
local Enabled = false script.Parent.MouseButton1Click:Connect(function() if not Enabled then Enabled = true game.Players.LocalPlayer.Backpack.Camera1.Disabled = false game.Players.LocalPlayer.PlayerGui.ScreenGui.CamButtons.Visible = true else Enabled = false game.Players.LocalPlayer.PlayerGui.ScreenGui.CamButtons.Visible = false workspace.CurrentCamera.CameraType = Enum.CameraType.Custom game.Players.LocalPlayer.Backpack.Camera2.Disabled = true game.Players.LocalPlayer.Backpack.Camera1.Disabled = true end end)
And finally, the "Camera1", "Camera2" local scripts. Both located in StarterPack
Camera 1 code:
while wait() do workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable workspace.CurrentCamera.CFrame = workspace.CameraPart1.CFrame end
Camera 2 code:
while wait() do workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable workspace.CurrentCamera.CFrame = workspace.CameraPart2.CFrame end
Again, im trying to make it so i can swap between the cameras as much as i want, but currently it only allows me to do it once for each camera. No errors or outputs.