Available since Version 1.0.
Executes a Lua file. If the same file is required again, it will not be executed again.
Syntax
File.RequireOnce( path )Arguments
- path (string): The path of the file to execute.
Return Values
- (boolean): Returns true if the file was successfully executed, or false if the file does not exist or an error occurred during execution.
Examples
local result = File.RequireOnce("path/to/another_script.lua")
if result then
print("File executed successfully!")
else
print("Failed to execute file.")
end