Hello, I’m trying to open a file (“garrysmod/models/player/newfile.mdl”) which does not exist in order to write content (binary) to it, using following code:
function savePlayerModel(data, filename) filename = file.Open("models/player/" .. fileName, "wb", "GAME") filename:Write(data) filename:Flush() filename:Close() end
file.Open(…) returns nil, even if I use an existing file.
What am I doing wrong?
Edit for future reference:
The error was, that the file must be a .txt file AND it must be written in the data folder.