如何在Roblox游戏模式中显示弹出消息?

时间:2021-09-11 16:59:39

I'm trying to parse chat messages for keywords that I will use to trigger various functions. In order to use the chat I have to test in game mode, which is started by first clicking Tools-> Test-> Start Server and then clicking Tools-> Test-> Start Player. The command window is not available in game mode so I need a way to get some debugging feedback. I figured a popup message would be good for that purpose.

我正在尝试解析我将用于触发各种功能的关键字的聊天消息。为了使用聊天,我必须在游戏模式下进行测试,首先单击工具 - >测试 - >启动服务器,然后单击工具 - >测试 - >启动播放器。命令窗口在游戏模式下不可用,所以我需要一种方法来获得一些调试反馈。我认为弹出消息对于这个目的是好的。

I suspect its fairly simple to display a popup message but I cant find any information on it.

我怀疑显示弹出消息相当简单,但我无法找到任何信息。

7 个解决方案

#1


Did you enable the Output window?

你启用了输出窗口吗?

View -> Output menu

Then e.g. if you script does

然后例如如果你的脚本

print("Hello world!")

You should see that in the output window. Else take a look at

您应该在输出窗口中看到它。别的,看看

How to add messages

如何添加消息

#2


Enable the output, Press Test >> Start Server In that new window press Test >> Start Player In the server window (Not the new player window), open the command bar and type:

启用输出,按测试>>启动服务器在该新窗口中按测试>>启动播放器在服务器窗口(不是新播放器窗口)中,打开命令栏并键入:

game.Players.Player.SuperSafeChat = false

And press enter. You can test it, and get output.

然后按Enter键。你可以测试它,并获得输出。

#3


to see the output, go into the server window, and make sure the output window is shown.

要查看输出,请进入服务器窗口,并确保显示输出窗口。

#4


While the following answers are of course correct, you CAN create a popup to display output from the...output. This can be done by overriding the default "print" function:

虽然以下答案当然是正确的,但您可以创建一个弹出窗口以显示...输出的输出。这可以通过覆盖默认的“print”函数来完成:

_G["dprint"] = _G.print
_G["print"] = function(...)
   pargs = {...}
   lMessage = Instance.new("Message")
   lMessage.Parent = workspace
   lMessage.Text = table.concat(pargs, " ") -- Is it concat?
   wait(10)
   lMessage:remove()

end

#5


native.showAlert(parameters list)

This can be best way to implement.

这可能是实施的最佳方式。

#6


There are some ways you can achieve this.

有一些方法可以实现这一目标。

  1. Roblox recently added a developer console that you can also use in game, so basically you can see the output window even online.
  2. Roblox最近添加了一个你也可以在游戏中使用的开发者控制台,所以基本上你甚至可以在线看到输出窗口。

  3. You can use Messages or Hints
  4. 您可以使用消息或提示

  5. You can make your own GUI
  6. 您可以制作自己的GUI

  7. If you don't need it online, you can use the output window.
  8. 如果您不需要在线,则可以使用输出窗口。

#7


ROBLOX has actually added a developer console (see it at the wiki: wiki.roblox.com/index.php?title=Developer_console) to the game client AND added its availability to studio 2015. You can access using the f9 button (or alt+f9 on laptops). You could've also opened the output window (see it at the wiki: wiki.roblox.com/index.php?title=Output) and see the errors there. Hope this helped!

ROBLOX实际上已经将一个开发者控制台(在wiki:wiki.roblox.com/index.php?title=Developer_console上看到)添加到游戏客户端并将其可用性添加到studio 2015.您可以使用f9按钮(或alt)进行访问笔记本电脑上的+ f9)。您还可以打开输出窗口(请参阅wiki:wiki.roblox.com/index.php?title=Output)并查看其中的错误。希望这有帮助!

#1


Did you enable the Output window?

你启用了输出窗口吗?

View -> Output menu

Then e.g. if you script does

然后例如如果你的脚本

print("Hello world!")

You should see that in the output window. Else take a look at

您应该在输出窗口中看到它。别的,看看

How to add messages

如何添加消息

#2


Enable the output, Press Test >> Start Server In that new window press Test >> Start Player In the server window (Not the new player window), open the command bar and type:

启用输出,按测试>>启动服务器在该新窗口中按测试>>启动播放器在服务器窗口(不是新播放器窗口)中,打开命令栏并键入:

game.Players.Player.SuperSafeChat = false

And press enter. You can test it, and get output.

然后按Enter键。你可以测试它,并获得输出。

#3


to see the output, go into the server window, and make sure the output window is shown.

要查看输出,请进入服务器窗口,并确保显示输出窗口。

#4


While the following answers are of course correct, you CAN create a popup to display output from the...output. This can be done by overriding the default "print" function:

虽然以下答案当然是正确的,但您可以创建一个弹出窗口以显示...输出的输出。这可以通过覆盖默认的“print”函数来完成:

_G["dprint"] = _G.print
_G["print"] = function(...)
   pargs = {...}
   lMessage = Instance.new("Message")
   lMessage.Parent = workspace
   lMessage.Text = table.concat(pargs, " ") -- Is it concat?
   wait(10)
   lMessage:remove()

end

#5


native.showAlert(parameters list)

This can be best way to implement.

这可能是实施的最佳方式。

#6


There are some ways you can achieve this.

有一些方法可以实现这一目标。

  1. Roblox recently added a developer console that you can also use in game, so basically you can see the output window even online.
  2. Roblox最近添加了一个你也可以在游戏中使用的开发者控制台,所以基本上你甚至可以在线看到输出窗口。

  3. You can use Messages or Hints
  4. 您可以使用消息或提示

  5. You can make your own GUI
  6. 您可以制作自己的GUI

  7. If you don't need it online, you can use the output window.
  8. 如果您不需要在线,则可以使用输出窗口。

#7


ROBLOX has actually added a developer console (see it at the wiki: wiki.roblox.com/index.php?title=Developer_console) to the game client AND added its availability to studio 2015. You can access using the f9 button (or alt+f9 on laptops). You could've also opened the output window (see it at the wiki: wiki.roblox.com/index.php?title=Output) and see the errors there. Hope this helped!

ROBLOX实际上已经将一个开发者控制台(在wiki:wiki.roblox.com/index.php?title=Developer_console上看到)添加到游戏客户端并将其可用性添加到studio 2015.您可以使用f9按钮(或alt)进行访问笔记本电脑上的+ f9)。您还可以打开输出窗口(请参阅wiki:wiki.roblox.com/index.php?title=Output)并查看其中的错误。希望这有帮助!