In this script I'm trying to have a brick clicked and change color, but on output it said that Spotlight is not a valid member of Part
local isOn = false local talk = script.Parent.talk function on() isOn = true talk.Value = true end function off() isOn = false talk.Value = false end function onClicked() if isOn == true then off() else on() end end script.Parent.ClickDetector.MouseClick:connect(onClicked) local Spotlight = script.Parent.SpotLight if isOn == true then Spotlight.Color = 255,58,24 end if isOn == true then Spotlight.Color = 0,0,255 end
This is what the Part looks like
Part ClickDirector Script Spotlight talk
Try watching PeasFactory, he'll have the simple one. This script is too much unnessecary codes... Watch his videos, he'll help alot!