ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. fileExists

Function

fileExists

Server and clientFilesIdentical to MTA:SA

Checks whether a file with this path exists.

Syntax

bool fileExists(string filePath)

Arguments

filePathstring
File path.

Returns

true when it exists.

Example

local file = fileExists("data.json") and fileOpen("data.json") or fileCreate("data.json")
fileClose(file)

See also