LuaAPI: Update HedgewarsScriptLoad
authorWuzzy
Mon, 03 Dec 2018 23:59:08 +0000
changeset 1641 e3ba8cad19d5
parent 1640 b91b4d97132d
child 1642 e8da1dd5c93c
LuaAPI: Update HedgewarsScriptLoad
LuaAPI.wiki
--- a/LuaAPI.wiki	Mon Dec 03 23:55:14 2018 +0000
+++ b/LuaAPI.wiki	Mon Dec 03 23:59:08 2018 +0000
@@ -1512,8 +1512,12 @@
 -- Disable the “Incoming” sound from being played</code>
 
 == File system functions ==
-=== <tt>!HedgewarsScriptLoad(scriptPath)</tt> ===
-Loads a script (i.e. a [LuaLibraries library]) from the specified `scriptPath`. The root directory is here Hedgewars’ data directory.
+=== <tt>!HedgewarsScriptLoad(scriptPath [,mustExist])</tt> ===
+Loads a script (i.e. a [LuaLibraries library]) from the specified `scriptPath`. The root directory is here Hedgewars’ data directory. There will be a Lua error if the script does not exist.
+
+If `mustExist` is `false`, no Lua error will happen even when the script does not exist.
+
+Returns `true` if the script was loaded successfully, `false` otherwise.
 
 Example:
 <code language="lua">