xtasy99 / dota2buttemplate_fixed

27 stars 14 forks source link

Table Contains #13

Closed GniLudio closed 2 years ago

GniLudio commented 2 years ago
function table.contains(t, v)
    if ("table"~=type(t)) then error("1st argument of table.contains() is not a table",2) end
    for _,v2 in pairs(t) do
        if v==v2 then
            return true
        end
    end
    return false
end