I’m having a weird issue where string.find is finding the number 5 every time, even when it’s not present in the string. I’m trying to isolate the numbers from strings using a string pattern, and this happens in a little test loop I wrote.
Here’s the code:
for i = 1, 15 do
local SlotName = "Slot"..i
print(SlotName)
local Number = string.find(SlotName, "%d")
print(Number)
end
Here’s the output:
As you can see, the SlotName prints as expected. The Number does not.
Any help is appreciated!