LuaAPI.wiki
changeset 1641 e3ba8cad19d5
parent 1640 b91b4d97132d
child 1642 e8da1dd5c93c
equal deleted inserted replaced
1640:b91b4d97132d 1641:e3ba8cad19d5
  1510 
  1510 
  1511 <code language="lua">SetSoundMask(sndIncoming, true)
  1511 <code language="lua">SetSoundMask(sndIncoming, true)
  1512 -- Disable the “Incoming” sound from being played</code>
  1512 -- Disable the “Incoming” sound from being played</code>
  1513 
  1513 
  1514 == File system functions ==
  1514 == File system functions ==
  1515 === <tt>!HedgewarsScriptLoad(scriptPath)</tt> ===
  1515 === <tt>!HedgewarsScriptLoad(scriptPath [,mustExist])</tt> ===
  1516 Loads a script (i.e. a [LuaLibraries library]) from the specified `scriptPath`. The root directory is here Hedgewars’ data directory.
  1516 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.
       
  1517 
       
  1518 If `mustExist` is `false`, no Lua error will happen even when the script does not exist.
       
  1519 
       
  1520 Returns `true` if the script was loaded successfully, `false` otherwise.
  1517 
  1521 
  1518 Example:
  1522 Example:
  1519 <code language="lua">
  1523 <code language="lua">
  1520 HedgewarsScriptLoad("/Scripts/Locale.lua")  -- loads locale library
  1524 HedgewarsScriptLoad("/Scripts/Locale.lua")  -- loads locale library
  1521 </code>
  1525 </code>