So as you have seen in the title I am getting an error, and I don't know how to fix it.
May be its this part... strInput = string.Explode("_", strType[2])
but I don't know.
function UpsClnStr( player,command,args )
strType = string.Explode("//", tostring(args))
if(args == "help") then ULib.tsay( player,"To clear a class type 'c//classType', To clear a certine model type 'm//modelString'" ) end
if(strType[1] == "m" or strType[1] == "M" or strType[1] == "m " or strType[1] == "M ") then
for _, ent in ipairs( ents.GetAll() ) do
if(ent:IsValid() and ent:GetModel() == strType[2]) then
if not (ent:IsWorld()) then
ent:Remove()
end
end
end
elseif(strType[1] == "c" or strType[1] == "C" or strType[1] == "c " or strType[1] == "C ") then
strInput = string.Explode("_", strType[2])
if( strInput[1] == "gmod" or strInput[1] == "prop" ) then
if not ( strInput[2] == "static" ) then
for _, ent in ipairs( ents.GetAll() ) do
if( ent:IsValid() and ent:GetClass() == strType[2] ) then
if not ( ent:IsWorld() ) then
ent:Remove()
end
end
end
end
end
end
ULib.tsay( nil,player:GetName().." has removed "..strType[2] )
end
concommand.Add( "ups_menu", UpsMenuContext )
concommand.Add( "ups_clnstr", UpsClnStr )
[@lua\includes\extensions\string.lua:34] bad argument #1 to 'string_gmatch' (string expected, got table)