So I have exactly the same problem with these methods like I have on Starfall preprocessor.
Basicaly I want to know if a string is found in another string. This is for a search box system.
I have a table listing all bans. I’d like when you type letter per letter the name of the player, it removes all lines which the serached name isn’t contained in.
I can give you this code :
//BanManagerList is the list of all bans //txt is the text in the search box for k, v in pairs(GameGlobal.BanManagerList) do if (string.find(string.upper(txt), string.upper(v.name))) then //The problem is here : only works when strings are identical... GameGlobal.BanManagerTempList:AddLine(v.id, v.name, v.hours, v.reason, v.note) end end