Warn (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
m Text replacement - "</code>" to "</SyntaxHighlight>"
m Text replacement - "<code lua>" to "<SyntaxHighlight code="lua">"
Line 8: Line 8:
==Example==
==Example==
This code would print <samp>Warning: this action is invalid</samp> to the output, in yellow text.
This code would print <samp>Warning: this action is invalid</samp> to the output, in yellow text.
<code lua>
<SyntaxHighlight code="lua">
game:GetService('TestService'):Warn(false, "this action is invalid")
game:GetService('TestService'):Warn(false, "this action is invalid")
</SyntaxHighlight>
</SyntaxHighlight>


[[Category:Methods]]
[[Category:Methods]]

Revision as of 04:08, 27 April 2023

Warn( bool condition, string description )
Returns nil
Description: If condition is true, prints Warning passed: , followed by description, to the output, in blue text. Otherwise, prints Warning: , followed by description, to the output, in yellow text.
Member of: TestService

Example

This code would print Warning: this action is invalid to the output, in yellow text.

game:GetService('TestService'):Warn(false, "this action is invalid")