0

# [SOLVED] Trying to Index nill with 'Value'?

Edited 1 month ago

I made a very small script to change a value, which in turn changes the camera angle in another script. The problem is this error. I don't know what i did wrong this time, but i hope to get some help here.

The script:

local cameraValues = game.ReplicatedStorage:FindFirstChild("CameraValues")

script.Parent.Touched:Connect(function()
cameraValues:FindFirstChild("Back").Value = false
cameraValues:FindFirstChild("Front").Value = true
cameraValues:FindFirstChild("Side").Value = false
end)


The full error:

19:21:28.378 Workspace.CameraFront.FrontChange:6: attempt to index nil with 'Value' - Server - FrontChange:6

Any help is appreciated!

There could be several things causing this error. First, verify in the explorer that "Side" is spelled correctly and is parented to cameraValuesas stated in the script. This error is due to the script not finding "Side" under cameraValues.