Skip to main content

أسماء بديلة

  • loadfileasync
  • dofile
  • dofileasync

الوسائط

string
مطلوب
File path resolved inside the workspace after separator normalization, workspace-boundary checks, and extension checks. Path, open, and read-size errors are thrown.
string
Optional chunk name passed to luau_load. Defaults to = when omitted or nil.

القيم الراجعة

function | nil
Loaded Luau function when luau_load succeeds. The function is not executed by loadfile.
string | nil
Error string returned as the second value only when luau_load fails. Filesystem and path errors are thrown instead.

مثال

حمل workspace Luau file كـ function، ثم استدعها بنفسك.