#How to reset the camera from scriptable mode???

1 messages · Page 1 of 1 (latest)

hollow rock
#

i have two scripts
and i am so confused as to what i do to fix my issue
someone send help

game:GetService("RunService").Heartbeat:Connect(function()
    if workspace:FindFirstChild("Camera") then
        if script:GetAttribute("HideGUI") == false then
            print("false")
            repeat task.wait() camera.CameraType = Enum.CameraType.Custom until camera.CameraType == Enum.CameraType.Custom
            camera.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
            game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
        elseif script:GetAttribute("HideGUI") == true then print("true") camera.CameraType = Enum.CameraType.Scriptable end
    end
end)

this script sets the mode from scriptable to custom based off an attribute every heart beat

local camera = workspace:FindFirstChild("Camera")
local part
repeat
    task.wait()
    part = workspace:WaitForChild("camPart", 5)
until part ~= nil

while task.wait(0.1) do
    print(camera.CameraType.Name)
    if camera.CameraType == Enum.CameraType.Scriptable then
        if script:GetAttribute("camPart2") == true then
            camera.CFrame = workspace:WaitForChild("camPart2").CFrame
        else
            camera.CFrame = part.CFrame
        end
    end
end

this script detects when it is set to scriptable and the loop should skip the condition of the camera being scriptable and returning control to the player (due to it being set to custom instead) but doesnt

mental field
hollow rock
#

@mental field I FOUND THE ISSUE

#

IT WAS LITERALLY JUST BECAUSE THE NAME OF THE SECOND SCRIPT WAS "CameraScript" AND BROKE IT