If the word is Solider how would I do it,
Without doing this:
String = "soldier1" Name = {"s", "o", "l", "i", "d", "e", "r") for i, in String do if String[i] = Name[i] then print (..i.. "Ok") -- This is rough I just done it now, this isn't supposed to be accurate.
This uses the sub method of the string class.
Change s1 and s2 to whatever you want. Also change the num variable for the number of letters you want to check.
local s1 = "soldier1" local s2 = "soldier" local num = 7 if #s1 >= num and #s2 >= num then if s1:sub(1, num) == s2:sub(1, num) then -- first {num} letters are the same end end