Script not detecting things bigger than 009

It detects “Mini001” until “Mini009” but “Mini010” til “Mini084” were not detected, anyone knows how to fix this?

local MinIndex = 1
local MaxIndex = 84
local CurrentIn = 0
local Path = game.Workspace.Minis.Ring4

for current = MinIndex, MaxIndex do
	CurrentIn = CurrentIn + 1
	local Names = "Mini000"
	if CurrentIn < 10 then
		Names = "Mini00"..CurrentIn
	else
		Names = "Mini"..CurrentIn
	end

	local lights = Path[Names].lights
	local water = Path[Names].Main.Nozzle.Water
	local refill = Path[Names].Main.Nozzle.Refill

	water:GetPropertyChangedSignal("Enabled"):Connect(function()
		for _, bulb in ipairs(lights:GetChildren()) do
			bulb.light.Brightness = 1
			bulb.light.Enabled = true
			bulb.Material = "Neon"
		end
	end)
	refill:GetPropertyChangedSignal("Enabled"):Connect(function()
		for _, bulb in ipairs(lights:GetChildren()) do
			bulb.light.Enabled = false
			bulb.Material = "Glass"
		end
	end)
end
1 Like

You forgot to add a 0 to “Mini”.

wow, bruh i did not see that. thank you so much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.