guiCheckBoxSetSelected | Multi Theft Auto: Wiki Skip to content

guiCheckBoxSetSelected

Client-side
Server-side
Shared

Pair: guiCheckBoxGetSelected

This function selects (ticks) or unselects a checkbox.

OOP Syntax Help! I don't understand this!

Syntax

bool guiCheckBoxSetSelected ( ​gui-checkbox theCheckbox, ​bool state )
Required arguments
  • theCheckbox: The GUI element in which you wish to change the selection state of.
  • state: The state of the checkbox, where true indicates selected, and false indicates unselected.

Returns

Returns true if the checkbox's selection state was successfully set, false otherwise.

  • bool: result

Code Examples

client
local checkedBox = guiCreateCheckBox(20,30,150,20,"Checked checkbox",true,false)
local uncheckedBox = guiCreateCheckBox(20,30,150,20,"UnChecked checkbox",false,false)
guiCheckBoxSetSelected(uncheckedBox, true)

See Also

GUI Functions