game = Click light0 game = Click light10 Part:Do
So this is written from a tablet sooooo stick with me here.
-- put this script in the part you want to be clicked on to enable the light local Light = script.Parent.Parent.SurfaceLight -- the light local Activation_Distance = 10 -- how many studs away it can be activated local clicker = Instance.new("ClickDetector") clicker.Parent = script.Parent clicker.MaxActivationDistance = Activation_Distance local db = false clicker.MouseClick:Connect(function() if not db then -- if the variable (db) is false light.Enabled = true -- enable the light else -- if the variable (db) is true light.Enabled = false -- disable the light end db = not db -- make the variable (db) the opposite of itself end)