ClassExists(string)
Description
Section titled “Description”The ClassExists Lua function returns a boolean indicating whether the provided string is a class.
Arguments
Section titled “Arguments”- String:
A string containing a single word that could be a class.
Return
Section titled “Return”-
Boolean:
The function returns a boolean.- True:
The provided word is a class. - False:
The provided input is not a class.
- True:
Example
Section titled “Example”This example asks if the word “Display” is a class and returns proper feedback.
| Copy CodeLua |
| ``` |
| return function() |
-- Store a string with the class namelocal className = "Display"-- Check if the class exists and then provide proper feedbackif ClassExists(className) then Printf("The class '%s' exists", className)else Printf("The class '%s' does not exists", className)endend