Camera Script doesn't work

Basically from

game.Starter.ScreenGui.PlayButton.MouseButton1Click:Connect(function()

to

cam.CameraType = Enum.CameraType.Custom

Everything else except the camera part works.

Change game.Statergui to game:GetService(“Players”).LocalPlayer.PlayerGui

The ScreenGui Destroy works, I’m only having issues with what I quoted. Edited my post, maybe now I can get some help, sorry for the inconvenience.

The error was and the solution for that is that I had to disconnect the service with

local service = game:GetService("RunService").RenderStepped:Connect(function()
    cam.CFrame = camPart.CFrame * CFrame.Angles(
        math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -mouseTilt),
        math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -mouseTilt),
        0
    )
end)

and end it with

service:Disconnect()

inside if hasBadge then