Having Trouble changing the DevCameraOcclusionMode by pressing a gui

local plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
 if plr.DevCameraOcclusionMode == 0 then
	plr.DevCameraOcclusionMode = 1
	script.Parent.Text = "Invisicam: Off"
else
	plr.DevCameraOcclusionMode = 0
	script.Parent.Text = "Invisicam: On"
end
	

end)

Hello We are updating a tower game often and I was trying to make an Invisicam On/Off button i try doing it but it keeps saying DevCameraOcclusionMode is a nil value
0 = Zoom
1 = Invisicam

please help me

This is not possible to do in-game. The property DevCameraOcclusionMode can only be changed by a plugin or the command-bar.

To learn more about normal identities and security tags, check out @Dekkonot’s public resource he wrote:

1 Like

so there is absolutely no way to make a button that can do that?

That is correct, this property cannot be changed by regular scripts running in-game. It currently has an identity of 5.

1 Like

you said it would work with the command bar, do you know if there is a way to run a command from script?

No, the command bar is only built into Studio. It simply allows you to quickly execute code on the fly within Studio.

1 Like

do you know if it will ever be changed so we can do it?

I doubt it will change unless there is a demand from developers to use it.

1 Like