file.FindInLua

From GMod Wiki

Revision as of 03:55, 11 May 2011 by immibis (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax file.FindInLua( String filename )
Where is this used?
Description:
Find a list of files within the Lua directory (also searches cache for the file)
Returns: Table (list of filenames, which are strings)
Part of Library: File
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=File.FindInLua]File.FindInLua [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis example finds all the Lua files in the toolgun's "stools" folder.
Used onNewerShared.png
Code
local list = file.FindInLua("weapons/gmod_tool/stools/*.lua")
for _, file in pairs(list) do
   print(file)
end
 
OutputThe names of the Lua files of all tools you have installed.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox