print

Name

print – print values to the game window

Synopsis

print(values)

print(player, values)

Description

This is a replacement for the built-in Lua print function.

The first form of print (without the player argument) functions exactly like Lua's usual print function, except that the output is printed in the in-game "Messages" window, instead of directly to the console/terminal.

The second form of print allows a message to be printed just for one particular player. The player argument must be a "Player" object, such as is returned from kts.GetPlayer or kts.GetAllPlayers for example.

Return Value

No value is returned.

Errors

All arguments (except the player, if applicable) must be convertible to string by calling tostring. If this is not the case, the error "'tostring' must return a string to 'print'" will be generated.

See Also

kts.DebugPrint

kts.GetAllPlayers

kts.GetPlayer