sendmovemsg(actor,1,250,0,100,3,'<outline color=\'#000000\' size=\'2\'><font color=\'#00ff00\' size=\'18\'>沙巴克奖励已增加</font></outline><outline color=\'#000000\' size=\'2\'><font color=\'#ff0000\' size=\'18\'>'..num..'</font></outline><outline color=\'#
🤖 回答引擎: 后端Lua |
🕒 时间: 2026-05-18 13:47:49 |
👁️ 阅读: 8
我是Lua后端老师!
小仙,我来帮你看看这段代码。你这里连续调用了三次`sendmovemsg`函数,但参数设置有些问题,而且看起来是想要显示三条不同位置的滚动消息吧?
根据资料显示,`sendmovemsg`函数的参数应该是这样的:
```lua
sendmovemsg(player, type, FColor, BColor, time, msg, showflag)
```
你的代码中参数顺序有些混乱,让我帮你修正一下:
```lua
-- 发送第一条滚动消息
sendmovemsg(actor, 1, 250, 0, 100, '<outline color=\'#000000\' size=\'2\'><font color=\'#00ff00\' size=\'18\'>沙巴克奖励已增加</font></outline><outline color=\'#000000\' size=\'2\'><font color=\'#ff0000\' size=\'18\'>'..num..'</font></outline><outline color=\'#000000\' size=\'2\'><font color=\'#00ff00\' size=\'18\'>奖励</font></outline>', 3)
-- 发送第二条滚动消息(位置不同)
sendmovemsg(actor, 1, 250, 0, 130, '<outline color=\'#000000\' size=\'2\'><font color=\'#00ff00\' size=\'18\'>沙巴克奖励已增加</font></outline><outline color=\'#000000\' size=\'2\'><font color=\'#ff0000\' size=\'18\'>'..num..'</font></outline><outline color=\'#000000\' size=\'2\'><font color=\'#00ff00\' size=\'18\'>奖励</font></outline>', 3)
-- 发送第三条滚动消息(位置不同)
sendmovemsg(actor, 1, 250, 0, 160, '<outline color=\'#000000\' size=\'2\'><font color=\'#00ff00\' size=\'18\'>沙巴克奖励已增加</font></outline><outline color=\'#000000\' size=\'2\'><font color=\'#ff0000\' size=\'18\'>'..num..'</font></outline><outline color=\'#000000\' size=\'2\'><font color=\'#00ff00\' size=\'18\'>奖励</font></outline>', 3)
```
**参数说明:**
- `actor`:玩家对象
- `1`:发送对象(1=自己)
- `250`:字体颜色
- `0`:背景颜色
- `100/130/160`:显示时间(毫秒)
- 消息内容:HTML格式的字符串
- `3`:是否显示人物名称(3这个值在资料中没有明确说明,可能需要检查是否正确)
小仙,这样修改后三条消息就会在不同时间显示,形成滚动效果了。如果你想让这三条消息同时显示,可以考虑使用`sendcentermsg`函数来显示居中公告,或者调整一下显示时间。
如果你还有其他问题,随时问我哦!
← 返回问答库