【问题标题】:Stop certain messages from sending in roblox阻止某些消息在 roblox 中发送
【发布时间】:2021-08-06 06:30:14
【问题描述】:

我正在尝试让某些命令(用于审核)不显示在 roblox 聊天中,但仍被 Player.Chatted 或类似事件接收。

提前谢谢你

【问题讨论】:

  • 你试过什么?您具体遇到了什么问题?

标签: lua chat roblox


【解决方案1】:

您可以通过编辑聊天模块来实现此目的。测试游戏时,在Explorer 选项卡中,转到Chat。复制服务中的所有内容,然后单击工作室测试上的停止。现在将所有内容粘贴到Chat 服务中。 (游戏外测试)。转到名为ChatScript 的本地脚本,然后转到ChatMain,最后打开名为MessageSender 的模块脚本。现在在第 15 行,您将看到一个名为 methods:SendMessage() 的函数。这是发送消息的函数。在此函数中,您可以编写任何您不想显示的审核命令。例如:

 local modCommands = {"!kick", "!ban"}
 function methods:SendMessage(message, toChannel)
    if table.find(modCommands,message) then
        --Message doesn't send to the chat, however it can still be picked up from a player.Chatted event
    else
        self.SayMessageRequest:FireServer(message, toChannel)
        --Message sends to the chat
end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-07-25
    • 1970-01-01
    • 2014-08-06
    • 1970-01-01
    • 2021-06-06
    • 1970-01-01
    • 2013-11-08
    相关资源
    最近更新 更多