Hello, I have an if statement here which is trying to compare the number on the second letter but it is a nil value. I used the type function and in printed that it was a number so any help?
if tonumber(string.sub(v.Name,2)) > total then
BTW total = 0. In the output it prints out attempt to compare number with a nil value.

3 comments
So if v. Name is equal to "1234" string.sub(v.Name,2) returns everything past character #2, so it would return "34". Now since your getting an nil value error, either total is somehow nil or v. Name is nil. Try printing total and v. Name, and string.sub(v.Name, 2) and tell me what the results are. Whenever something I made has a weird bug, I print all the values so I can see what variable is
if you want to just get the seccond letter you need string.sub(thing,2,2)
Lol