Players.MATIEO33.Backpack.SMG.LocalScript:1: attempt to index nil with 'Unequipped'

Yeah I need help once again. I am very new to scripting but I need help with this script. The thing I wanted is to fix the camera after the tool is unequipped, but this error appears that I don’t know how to fix. I would appreciate all help.

Tool.Unequipped:Connect(function()
	game.Workspace.CurrentCamera:remove()
	wait(.1)
	game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
	game.Workspace.CurrentCamera.CameraType = "Custom"
end)
script.Parent.Selected:connected(onActivation)

That just means that your Tool variable is nil. You maybe made a typo or forgot to declare the variable.

Also, Instance::remove and HopperBins and RBXScriptSignal::connect are deprecated. Switch to Instance::Destroy (why are you destroying the camera!!!), Tools, and RBXScriptSignal::Connect respectively. :coefficients:

2 Likes