Need to fix this script (Model name detection)

Hello, i have this script that detects the models inside a folder

local Lilyndex = 1
local MaxIndex = 85
local CurrentIn = 0
local Path = script.Parent

for current = Lilyndex, MaxIndex do
	CurrentIn = CurrentIn + 1
	local Names = "Lily000"
	if CurrentIn < 10 then
		Names = "Lily00"..CurrentIn
	else
		if CurrentIn < 100 then
			Names = "Lily0"..CurrentIn
		else
			Names = "Lily"..CurrentIn
		end
	end
end

image
“Script” is where it is located

The problem: I named them like this for a reason, but starting at Lily011 the model wont get any changes. It seems like the script are trying to find “Lily004” though in this case it shouldn’t exist, how to fix this script?

Could this work for you? This script gets all the models in script parent and index thems in order.

local Models = script.Parent:GetChildren()

for _, Model in ipairs(Models) do
	if Model:IsA("Model") then
		local modelName = Model.Name

		local index = tonumber(modelName:match("Lily(%d+)"))
		if index then
			print("Found model:", modelName)
		end
	end
end

image
image