Camera script not working

I’m making a remote event that when you activate it and put a bool value that is true, the camera turns into a sort of 2D platformer game camera. The problem is that, after activating the remote event with the value true, then later activating it as false, it still does the 2D camera.
(local script) Code:

game.ReplicatedStorage.CamFollowPlayer.OnClientEvent:Connect(function(thing)
	local player = game.Players.LocalPlayer
	local camera = workspace.CurrentCamera
	camera.CameraSubject = player.Character.HumanoidRootPart
	camera.CameraType = Enum.CameraType.Attach
	camera.FieldOfView = 40

	game:GetService("RunService").RenderStepped:Connect(function()
		if thing == true then
		workspace.Cut.Position = player.Character.HumanoidRootPart.Position + Vector3.new(20, 0, 0)
			camera.CFrame = workspace.Cut.CFrame
		end
		if thing == false then
			print("yeah it's false")
		end
	end)
end)

thing is given from the event correct? If you are passing a bool value, make sure you say

if thing.Value == true then
etc...

Yes, I stated that in my message.

Ah sorry, got a bit confused, I thought you just meant changing the bool value and sending the Instance.

Do you know why it isn’t working?

An instance of thing is created each time the outer connection is fired, they do not cross between each execution of the function.

Oh, so should I put a variable outside of the function and when the function is activated, I would do randomVariable = thing?

Yeah, and then swap the other references to thing with that non-local variable/upvalue.

Can you explain in simpler terms? I do not understand this sentence.
Edit: Oh I understand, by the way, it doesn’t work.
Edit: Nvm, it does.