Hello guys I understand how fileRead() and fileFind() in terms of .lua files in the LUA directory, however, for some reason when I try with .txt files in the DATA folder I’m having issues finding and reading from the file.
My .txt file location is at: …garrysmod/addons/[addon name]/data/fileiwant.txt
fileiwant.txt contents are: “Hello.”
What I’ve attempted in order to find / read from the file :
--Method 1: Locate the file local files, directories = file.Find( "*", "DATA" ) PrintTable( files ) -- Shows a table of files that does not include fileiwant.txt --Method 2: reading from fileiwant.txt directly local Data = file.Read( "fileiwant.txt", "DATA" ) print ( Data ) -- Prints nil rather than "Hello." likely because it isn't found.
Does the .txt file have to be downloaded by the client? Am I just not placing it/seeking it correctly?