I was working on a Light System which when the power switch is off all lights turn off (basically mall) but before implementing it i decided to test it first however when trying it pointlight doesn’t worked but no errors what so ever in the output nothing
here’s the script
local GreenGo = game.Workspace.GreenGo
local StepMe = game.Workspace.StepMe
local TestLight = game.Workspace.GreenGo.TestLight
function onTouched(part)
for index, object in next, game.Workspace:GetChildren() do
if object:IsA('Part') then
if object.Name == 'GreenGo' then
object.BrickColor = BrickColor.new('Lime green')
object.Material = Enum.Material.Neon
end
if object:IsA('PointLight') then
if object.Name == 'Testlight' then
object.Testlight.Enabled = true
print ('Testing1')
end
end
end
end
end
function LightTouched(part)
for index, object in next, game.Workspace:GetChildren() do
if object:IsA('PointLight') then
if object.Name == 'Testlight' then
object.Testlight.Enabled = true
print ('Testing1')
end
end
end
end
StepMe.Touched:Connect(onTouched)
StepMe.Touched:Connect(LightTouched)
Some function came from a forum post while other function (Touched:Connect and Part Function) is the ones that im testing with
Thanks in advance!