im making a script that checks wether the torch is on or off, and changes it, but its not working, can anyone help
local isEnabled = false
local light = script.Parent.Light
script.Parent.Activated:Connect(function()
if script.Parent.IsEnabled == false then
light.Color = Color3.new(0.972549, 0.85098, 0.427451)
light.Material = Enum.Material.Neon
light.SpotLight.Enabled = true
isEnabled = true
end
end)
script.Parent.Activated:Connect(function()
if script.Parent.IsEnabled == true then
light.Color = Color3.new(0, 0, 0)
light.Material = Enum.Material.SmoothPlastic
light.SpotLight.Enabled = false
isEnabled = false
end
end)

1 comment
this worked! thank yoy