Check (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>JulienDethurens Created page with "<onlyinclude>{{Method |name = Check |arguments = {{type|bool}} <var>condition</var>, {{type|string}} <var>description</var> |description = ..." |
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>" |
||
(17 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
|name = Check | |name = Check | ||
|arguments = {{type|bool}} <var>condition</var>, {{type|string}} <var>description</var> | |arguments = {{type|bool}} <var>condition</var>, {{type|string}} <var>description</var> | ||
|description = If <var>condition</var> is {{true}}, prints "<samp>Check passed: </samp>", followed by <var>description</var> to the output, in blue text. Otherwise, prints "<samp>Check failed: </samp>", again, followed by <var>description</var>, but in red text | |description = If <var>condition</var> is {{true}}, prints "<samp style="color: blue;">Check passed: </samp>", followed by <var>description</var> to the output, in blue text. Otherwise, prints "<samp style="color: red;">Check failed: </samp>", again, followed by <var>description</var>, but in red text. | ||
|object = TestService | |object = TestService | ||
}}</onlyinclude> | }}</onlyinclude> | ||
{{clear floats}} | |||
==Example== | |||
This code would print <samp>Check failed: example</samp> to the output, in red text. | |||
<syntaxhighlight lang="lua"> | |||
game:GetService('TestService'):Check(false, "example") | |||
</syntaxhighlight> | |||
[[Category:Methods]] | [[Category:Methods]] |
Latest revision as of 05:10, 27 April 2023
![]() | |
Returns | nil |
Description: | If condition is true, prints "Check passed: ", followed by description to the output, in blue text. Otherwise, prints "Check failed: ", again, followed by description, but in red text. |
Member of: | TestService |
Example
This code would print Check failed: example to the output, in red text.
game:GetService('TestService'):Check(false, "example")