<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.waylee.net/index.php?action=history&amp;feed=atom&amp;title=Lua%E6%8E%A5%E5%8F%A3%2F%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3</id>
	<title>Lua接口/货币相关 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.waylee.net/index.php?action=history&amp;feed=atom&amp;title=Lua%E6%8E%A5%E5%8F%A3%2F%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3"/>
	<link rel="alternate" type="text/html" href="https://www.waylee.net/index.php?title=Lua%E6%8E%A5%E5%8F%A3/%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3&amp;action=history"/>
	<updated>2026-09-12T04:54:13Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://www.waylee.net/index.php?title=Lua%E6%8E%A5%E5%8F%A3/%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3&amp;diff=1485&amp;oldid=prev</id>
		<title>雪舞：​维护服务端 Lua 接口：核对参数、返回值、边界条件与调用示例</title>
		<link rel="alternate" type="text/html" href="https://www.waylee.net/index.php?title=Lua%E6%8E%A5%E5%8F%A3/%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3&amp;diff=1485&amp;oldid=prev"/>
		<updated>2026-09-12T04:30:04Z</updated>

		<summary type="html">&lt;p&gt;维护服务端 Lua 接口：核对参数、返回值、边界条件与调用示例&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年9月12日 (六) 12:30的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l82&quot;&gt;第82行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第82行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua接口/背包空间|背包空间]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua接口/背包空间|背包空间]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua接口/装备操作|装备操作]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua接口/装备操作|装备操作]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Lua接口/任务状态|任务状态]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Lua接口/任务变量|任务变量]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Lua接口/NPC对话|NPC 对话]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Lua接口/对话选项|对话选项]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Lua接口/服务端调用约定|服务端调用约定]] · [[Lua接口/服务端调用示例|服务端调用示例]] · [[Lua接口/服务端函数索引|服务端函数索引]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Lua接口/服务端调用约定|服务端调用约定]] · [[Lua接口/服务端调用示例|服务端调用示例]] · [[Lua接口/服务端函数索引|服务端函数索引]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>雪舞</name></author>
	</entry>
	<entry>
		<id>https://www.waylee.net/index.php?title=Lua%E6%8E%A5%E5%8F%A3/%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3&amp;diff=1477&amp;oldid=prev</id>
		<title>雪舞：​维护服务端 Lua 接口：核对参数、返回值、边界条件与调用示例</title>
		<link rel="alternate" type="text/html" href="https://www.waylee.net/index.php?title=Lua%E6%8E%A5%E5%8F%A3/%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3&amp;diff=1477&amp;oldid=prev"/>
		<updated>2026-09-12T03:45:12Z</updated>

		<summary type="html">&lt;p&gt;维护服务端 Lua 接口：核对参数、返回值、边界条件与调用示例&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年9月12日 (六) 11:45的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l78&quot;&gt;第78行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第78行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua接口/等级与经验|等级与经验]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua接口/等级与经验|等级与经验]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua接口/货币相关|货币相关]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Lua接口/货币相关|货币相关]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Lua接口/物品查询|物品查询]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Lua接口/物品发放与扣除|物品发放与扣除]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Lua接口/背包空间|背包空间]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Lua接口/装备操作|装备操作]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Lua接口/服务端调用约定|服务端调用约定]] · [[Lua接口/服务端调用示例|服务端调用示例]] · [[Lua接口/服务端函数索引|服务端函数索引]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Lua接口/服务端调用约定|服务端调用约定]] · [[Lua接口/服务端调用示例|服务端调用示例]] · [[Lua接口/服务端函数索引|服务端函数索引]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>雪舞</name></author>
	</entry>
	<entry>
		<id>https://www.waylee.net/index.php?title=Lua%E6%8E%A5%E5%8F%A3/%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3&amp;diff=1473&amp;oldid=prev</id>
		<title>雪舞：​维护服务端 Lua 接口：核对参数、返回值、边界条件与调用示例</title>
		<link rel="alternate" type="text/html" href="https://www.waylee.net/index.php?title=Lua%E6%8E%A5%E5%8F%A3/%E8%B4%A7%E5%B8%81%E7%9B%B8%E5%85%B3&amp;diff=1473&amp;oldid=prev"/>
		<updated>2026-09-11T20:16:39Z</updated>

		<summary type="html">&lt;p&gt;维护服务端 Lua 接口：核对参数、返回值、边界条件与调用示例&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;lua-reference&amp;quot; style=&amp;quot;max-width:1200px;margin:0 auto;line-height:1.8;color:#29343a;font-family:Arial,&amp;#039;Microsoft YaHei&amp;#039;,sans-serif;letter-spacing:0;overflow-wrap:anywhere;&amp;quot;&amp;gt;&lt;br /&gt;
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端调用约定|调用约定]]&lt;br /&gt;
&lt;br /&gt;
读写现金、交子与银行金币，以及扣款优先级。先看接口的货币口径：现金与交子是两类账户，部分接口会联动世界服统计。&lt;br /&gt;
&lt;br /&gt;
== 现金 ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:left;background:#edf3f2;padding:8px;&amp;quot; | 接口&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:left;background:#edf3f2;padding:8px;&amp;quot; | 参数与返回&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | [[Lua接口/服务端/GetMoney|GetMoney]]&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;sceneId, selfId&amp;lt;/code&amp;gt; → 玩家现金。&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | [[Lua接口/服务端/AddMoney|AddMoney]]&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;sceneId, selfId, profit, arg4, arg5&amp;lt;/code&amp;gt; → 5 个参数，后两项不可省略。&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | [[Lua接口/服务端/CostMoney|CostMoney]]&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;sceneId, selfId, payment&amp;lt;/code&amp;gt; → 扣除现金。&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | [[Lua接口/服务端/LuaFnCostMoneyWithPriority|LuaFnCostMoneyWithPriority]]&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;sceneId, selfId, cost&amp;lt;/code&amp;gt; → 按接口约定的优先级扣款；返回 1 或 2 个值。&lt;br /&gt;
|}&lt;br /&gt;
[[Lua接口/服务端/AddMoney|AddMoney]] 的签名是 5 个参数，**不能省略 arg4、arg5**：缺参会让校验器按数量报错，运行时也按位置读取。[[Lua接口/服务端/CostMoney|CostMoney]] 只扣现金，金额不足时走失败路径，**不会自动转扣交子**；要按优先级扣款应改用 [[Lua接口/服务端/LuaFnCostMoneyWithPriority|LuaFnCostMoneyWithPriority]]，它可能返回 1 或 2 个值，少接收变量会丢掉第二项。&lt;br /&gt;
&lt;br /&gt;
== 交子 ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:left;background:#edf3f2;padding:8px;&amp;quot; | 接口&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:left;background:#edf3f2;padding:8px;&amp;quot; | 参数与返回&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | [[Lua接口/服务端/GetMoneyJZ|GetMoneyJZ]]&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;sceneId, selfId&amp;lt;/code&amp;gt; → 交子数量。&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | [[Lua接口/服务端/AddMoneyJZ|AddMoneyJZ]]&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;sceneId, selfId, value&amp;lt;/code&amp;gt; → 增加交子；返回 1 成功、0 失败。&lt;br /&gt;
|}&lt;br /&gt;
[[Lua接口/服务端/AddMoneyJZ|AddMoneyJZ]] 会同步世界服交子收入统计，返回 1 表示成功、0 表示失败，可用 &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;== 1&amp;lt;/code&amp;gt; 判断。&lt;br /&gt;
&lt;br /&gt;
== 银行与统计 ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:left;background:#edf3f2;padding:8px;&amp;quot; | 接口&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:left;background:#edf3f2;padding:8px;&amp;quot; | 参数与返回&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | [[Lua接口/服务端/AddBankMoney|AddBankMoney]]&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;sceneId, selfId, value&amp;lt;/code&amp;gt; → 增加银行金币并写入资金审计。&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | [[Lua接口/服务端/LuaFnGetHumanGoodBadValue|LuaFnGetHumanGoodBadValue]]&lt;br /&gt;
| style=&amp;quot;padding:8px;vertical-align:top;overflow-wrap:anywhere;&amp;quot; | &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;sceneId, selfId&amp;lt;/code&amp;gt; → 善恶值（与货币口径不同，单独维护）。&lt;br /&gt;
|}&lt;br /&gt;
[[Lua接口/服务端/AddBankMoney|AddBankMoney]] 会同时同步世界服金币系统总量，调用即记入资金审计，不能当作无副作用调试调用。善恶值是单独维护的数值，不能与现金、交子互换。&lt;br /&gt;
&lt;br /&gt;
== 读取现金 ==&lt;br /&gt;
&amp;lt;pre style=&amp;quot;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;&amp;quot;&amp;gt;local money = GetMoney(sceneId, selfId)&lt;br /&gt;
if type(money) == &amp;quot;number&amp;quot; and money &amp;amp;gt;= 0 then&lt;br /&gt;
    -- 取得现金数量&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Lua接口/服务端/GetMoney|GetMoney]] 返回数值。先判类型再判范围，避免把异常返回当有效现金。&lt;br /&gt;
&lt;br /&gt;
== 扣款 ==&lt;br /&gt;
&amp;lt;pre style=&amp;quot;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;&amp;quot;&amp;gt;local ok = CostMoney(sceneId, selfId, 1000)&lt;br /&gt;
if ok == 1 then&lt;br /&gt;
    -- 现金扣除成功&lt;br /&gt;
else&lt;br /&gt;
    -- 现金不足或失败；不会自动扣交子&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Lua接口/服务端/CostMoney|CostMoney]] 失败不自动转扣交子。需要按「先现金后交子」之类优先级扣款，改用 [[Lua接口/服务端/LuaFnCostMoneyWithPriority|LuaFnCostMoneyWithPriority]]，并按 1 或 2 个返回值接收。&lt;br /&gt;
&lt;br /&gt;
== 按优先级扣款 ==&lt;br /&gt;
&amp;lt;pre style=&amp;quot;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;&amp;quot;&amp;gt;local ok, deducted = LuaFnCostMoneyWithPriority(sceneId, selfId, 1000)&lt;br /&gt;
if type(ok) == &amp;quot;number&amp;quot; then&lt;br /&gt;
    -- ok 表示扣款结果；第二项视分支可能为 nil&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Lua接口/服务端/LuaFnCostMoneyWithPriority|LuaFnCostMoneyWithPriority]] 返回数量可变，用两个变量接收并先判第一项类型；不要只接一项，也不要用 &amp;lt;code style=&amp;quot;white-space:normal;overflow-wrap:anywhere;&amp;quot;&amp;gt;if LuaFnCostMoneyWithPriority(...) then&amp;lt;/code&amp;gt;，避免把 0 当假。&lt;br /&gt;
&lt;br /&gt;
== 相关主题 ==&lt;br /&gt;
* [[Lua接口/角色信息|角色信息]]&lt;br /&gt;
* [[Lua接口/属性读取与修改|属性读取与修改]]&lt;br /&gt;
* [[Lua接口/等级与经验|等级与经验]]&lt;br /&gt;
* [[Lua接口/货币相关|货币相关]]&lt;br /&gt;
&lt;br /&gt;
[[Lua接口/服务端调用约定|服务端调用约定]] · [[Lua接口/服务端调用示例|服务端调用示例]] · [[Lua接口/服务端函数索引|服务端函数索引]]&lt;br /&gt;
&lt;br /&gt;
[[Lua接口/函数不存在|函数不存在或提示 nil]] · [[Lua接口/参数类型与顺序|参数类型与顺序]] · [[Lua接口/返回值判断|返回值判断]] · [[Lua接口/对象ID与GUID|对象 ID 与 GUID]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:20px;padding-top:10px;border-top:1px solid #dbe3e6;color:#657078;font-size:12px;&amp;quot;&amp;gt;本页函数签名与返回约定依据当前服务端注册表整理；sceneId、selfId 由实际回调提供，业务枚举、属性类型编号与运行效果需要实测。&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>雪舞</name></author>
	</entry>
</feed>