util.tobool

From GMod Wiki

Revision as of 20:01, 23 December 2009 by Commander2040 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax util.tobool( Number or String value )
Where is this used?
Description:
Turns the value 0, "0", "false" or nil into boolean false. Anything else is boolean true.
Returns: Boolean
Part of Library: Util
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Util.tobool]Util.tobool [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionEvaluates a value.
Used onNewerShared.png
Code
util.tobool(0)
Outputfalse
DescriptionEvaluates the value.
Used onNewerShared.png
Code
util.tobool(1)
Outputtrue
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox