So, I'm completely new to Lua, and have almost no clue what I am doing, but I'm trying my best to learn it. I'm trying to turn a PointLight off at the start of the game by changing the values of the Brightness. I know I can just uncheck Enable in the PointLight settings, but I want to use this light later to do the opposite effect, making it slowly fade to being bright again.
local light = script.Parent
---------------------------------
function turnoff()
for light = 0, 1, 0.5 do
light.Brightness = 4.16
wait(0.5)
light.Brightness = 0
print ("Off")
end
end
---------------------------------
wait(15)
turnoff()
The problem is, when I run the game, I get an error that says " Workspace.void light.Part.PointLight.Script:7: attempt to index number with 'Brightness' ". I've been trying to do something as simple as this for 2 days now, and can't find any help with google. Thanks.

1 comment
Thanks so much, I can't believe it was that simple of a fix