isfile

Checks whether a file exists in Workspace.

Syntax

Signature
isfile(Path: string) -> boolean

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
PathstringPath relative to the sandboxed Workspace.

Returns

TypeDescription
booleanTrue for an existing regular file.

Notes

A missing path returns false. Invalid paths and filesystem errors raise a Luau error.

Example

Luau
local Result = isfile("Example.txt")
print(Result)