KcdMp_exec
Runs a Lua file from disk - the development way to try a client script.
The file is read from disk and run on the game thread on the next frame, with the game’s whole Lua (no sandbox: it is the
player’s own file); a relative path is relative to the KCD:MP install folder (where KcdMp_client.dll lives). The same
file can be named on the game’s command line as -KcdMp_exec <file.lua> - through the launcher’s Game arguments - to
run two seconds after the level is ready. A syntax error is reported in the client log with its line. The scripts a
server sends need none of this: they arrive with the join and run by themselves.
Syntax
Section titled “Syntax”KcdMp_exec <file>| Parameter | Type | |
|---|---|---|
file |
path | the Lua file, relative to the install folder or absolute |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”KcdMp_exec scripts/arena_client.luaSee also
Section titled “See also”KcdMp_log · the Console commands group of the index
