I'm attempting to make a horror game on Roblox, when you interact with this light switch its supposed to turn them on, but whenever I try it doesn't work, and the output says,"Workspace.Lights.Part.Script:3: attempt to call a nil value" what does this mean?
my code:
script.Parent.ProximityPrompt.Triggered:Connect(function()
local light = script.Parent.Parent:GetChildren("Light")
local pointlight = light:GetChildren("PointLight")
pointlight.Enabled = true
local click = light:GetChildren("Click")
click:Play()
script.Parent.ProximityPrompt.Enabled = false
end)
please help.

1 comment
click is a sound effect by the way