String.sub help

lets say I wanted to make a string.sub thing where it will find the model that has “Kunai” In It, how would i do that
the name of the model will be randomly generated but will have kunai In It

You will have to iterate through all the models and check if their name contains “Kunai” with either string.find or string.match. You can’t use string.sub because it is used for getting a part of string with given startindex and endindex, not finding sub-strings. Here is an example:

local Models = workspace.Models:GetChildren() --You will have to modify this for your use.
for Index, Value in pairs(Models) do
    if string.find(Value.Name, "Kunai") ~= nil then --You might also have to add a class check if there are other instances that contains "Kunai" sub-string.
        print("Found the model "..Value.Name)