#Broken nil script

5 messages · Page 1 of 1 (latest)

lilac basin
#

I'm tryna to make a script where if it detects that a light is missing it turns the brick into plastic and change the color to 0, 0, 0

local Light = script.Parent

local Shine = script.Parent.PointLight

if Light:FindFirstChild("Shine") == nil then
    Light.Material = Plastic
    Light.Color = 0, 0, 0
end```

I don't know what I did wrong and why it won't work.
#

This is a normal script btw

#

fixed a part of it. here is the current script

local Light = script.Parent

local Shine = script.Parent.PointLight

if Light:FindFirstChild("Shine") == nil then
    Light.Material = ("Plastic")
end```
lilac basin
#

It's still broken btw

craggy surge
#

make the if statement repeat like every second ig so itll check if its removed or not