Local script doesnt recognize SurfaceLight

It thinks that there is nothing called “SurfaceLight” inside of handle (see image below)

It was working before but I closed the studio and it didnt save? (i didnt save it to roblox so maybe thats why)
edit: i think i pressed no when it asked me to save

2 Likes

Could you show your code?

I’m guessing that you are referencing it before SurfaceLight loads into the game.

local uis = game:GetService("UserInputService")
local on = false
script.Parent.SurfaceLight.Brightness = 0
uis.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.F then
		if on == false then
			script.Parent.SurfaceLight.Brightness = 10
			on = true
		else
			script.Parent.SurfaceLight.Brightness = 0
			on = false
		end
	end
end)

was my code, but i added a task.wait(5) on the top and now it seems to work.