Script stopped working

I’m just joined roblox studio and script stopped working .Local script:

local Camera = script.Parent.Parent.CurrentCamera

script.Parent.MouseButton1Click:Connect(function()

script.Parent.Camera:Play()

Camera.Value = game.Workspace.Cameras["1B"]

end)

while wait(0.01) do

if script.Parent.Parent.CurrentCamera.Value == game.Workspace.Cameras["1B"] then

game.Workspace.Cameras["1B"].Checking.Value = true

else

game.Workspace.Cameras["1B"].Checking.Value = false

end

end

Did it work before? Are you getting any errors? We need to know what the problem is. An explanation of what it is supposed to do is also useful.

What’s the camera?

This text will be blurred

This is a animation. This is not camera

I’m think im did something wrong i deleted everything that I broke and fixed.

This text will be blurred

Are you getting any errors in the output?

If so, share them here and you may get more help.

If not, try verifying if the script (or whatever you’re doing inside of the script) actually runs. An easy way to do this is by putting print()statements in some parts of your code. Your next steps will depend on where the code stops or whether it runs at all.

1 Like

Can you send a photo of where your script is located? I don’t know what the script.Parent is.

Try this

local Camera = script.Parent.Parent.CurrentCamera

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Camera:Play()
    Camera.CameraSubject = game.Workspace.Cameras["1B"]
    Camera.CFrame = game.Workspace.Cameras["1B"].CFrame
end)

while wait(0.01) do
    if script.Parent.Parent.CurrentCamera.CFrame == game.Workspace.Cameras["1B"].CFrame then
        game.Workspace.Cameras["1B"].Checking.Value = true
    else
        game.Workspace.Cameras["1B"].Checking.Value = false
    end
end

btw, there’s nothing called “CurrentCamera.Value” :confused:

Try using the printing method, see if it does print or not.