So, I have been working on an anti virus currently.

And, I want to implement a check for if a script matches a line of code with a amount of percentage, then it will detect it as a threat.

I've tried this:

local StringToMatch = "me me me me me me me me me you"
local String = "me me me me me me me me me you"
local Percentage = 0
local EachFind = #StringToMatch:split(" ")/#String:split(" ")

for i,v in pairs(StringToMatch:split(" ")) do
	for i2,v2 in pairs(String:split(" ")) do
		if v:lower() == v2:lower() then
			Percentage = Percentage + EachFind
		end
	end
end
print("Matched "..Percentage.."%!")

But it prints

Matched 81%!

While... it's the same string? Every bit of help is appreciated!