-
Notifications
You must be signed in to change notification settings - Fork 350
parseBoolean
Toon edited this page Jan 5, 2026
·
2 revisions
boolean parseBoolean(<string> raw, <string> default)
Note: default is optional and not required
Returns true if raw matches one of these strings: true, t, 1, yes, y, on, enable, enabled.
Returns false if raw matches one of these strings: false, f, 0, no, n, off, disable, disabled.
Returns what you've used for default (or false) if none of the above strings were matched.
-- Note: This is just a snippet
-- Example of a possible command: shouldreset true
["Function"] = function(args, speaker)
if parseBoolean(args[1]) then
notify("Player should reset.")
else
notify("Player should not reset.")
end
endClick here for a full plugin example
local Plugin = {
["PluginName"] = "wiki example",
["PluginDescription"] = "an example from the wiki",
["Commands"] = {
["shouldreset"] = {
["ListName"] = "shouldreset [boolean]",
["Description"] = "DESCRIPTION HERE",
["Aliases"] = {},
["Function"] = function(args, speaker)
if parseBoolean(args[1]) then
notify("Player should reset.")
else
notify("Player should not reset.")
end
end
}
}
}
return PluginInfinite Yield
Plugins
Core Functions