widget.set_text
Set the HUD widget's text.
Arguments
- text
A string literal or an integer constant denoting a string index, optionally followed by up to two variables passed as additional arguments, which will be substituted into the string when it is displayed.
Example
for each player do script_widget[0].set_visibility(current_player, false) if current_player.number[0] == 1 then script_widget[0].set_visibility(current_player, true) script_widget[0].set_text("You are a zombie!") end end
Notes
-
A HUD widget must display the same format string to all players. If you may need to display completely different text to different players at the same time, you will need to define multiple widgets and manage their visibility and text appropriately.
Some format string parameters make it possible to display different values within a single string, for each player viewing the widget. The hud_player variable is one such parameter.