From Multi Theft Auto: Wiki
Revision as of 11:59, 30 April 2016 by GabWas (talk | contribs) (Small mistake :-))
Jump to navigation Jump to search

A boolean or bool is a datatype whose value can be either true or false. These are often returned by functions to indicate whether the operation was successful or not.

Using the lua functions tostring() and type() can help you to find out what datatype something is:

local theReturn = isPedDead(getRandomPlayer())
outputChatBox("The return was: "..tostring(theReturn)) -- Will say: "true" or "false"
outputChatBox("The datatype of this return was: "..type(theReturn)) -- Will say "boolean"