Hello, i used this script to check if water’s Enabled property has changed to enable a light
local MinIndex = 1
local MaxIndex = 2
local CurrentIn = 0
local Path = script.Parent
for current = MinIndex, MaxIndex do
CurrentIn = CurrentIn + 1
local Names = "Mini000"
if CurrentIn < 10 then
Names = "Mini00"..CurrentIn
else
if CurrentIn < 100 then
Names = "Mini0"..CurrentIn
else
Names = "Mini"..CurrentIn
end
end
local lights = Path[Names].Lighting.Lights
local WEnabled = Path[Names].Nozzle.WaterEnabled
local water = Path[Names].Nozzle.Water
local refill = Path[Names].Nozzle.Refill
water:GetPropertyChangedSignal("Enabled"):Connect(function()
if WEnabled.Value == 1 then
WEnabled.Value = 0
for _, bulb in ipairs(lights:GetChildren()) do
if bulb.Name == "bulb" then
bulb.light.Brightness = 1
bulb.light.Enabled = true
bulb.Material = "Neon"
end
end
end
end)
end
how to make that this part to only checks that when Enabled == true instead of checking both true and false?
water:GetPropertyChangedSignal("Enabled"):Connect(function()`