guiEditIsMasked | Multi Theft Auto: Wiki Skip to content

guiEditIsMasked

Client-side
Server-side
Shared

Pair: guiEditSetMasked

This function checks if an edit box is masked.

OOP Syntax Help! I don't understand this!

  • Variable: .masked

Syntax

bool guiEditIsMasked ( ​gui-edit guiEdit )
Required arguments
  • guiEdit: The edit box to check masked flag of.

Returns

Returns true if the edit box is masked, false if not, nil if an invalid edit box was provided.

  • bool: result

Code Examples

client
local password
function createPasswordEdit()
password = guiCreateEdit(0.845, 0.94, 0.15, 0.05, "password", true) -- create edit box for a password
if password then -- if it was successfully created
guiEditSetMasked(password, true) -- make it masked
end
end
addEventHandler("onClientResourceStart", resourceRoot, createPasswordEdit)
addCommandHandler("isMasked", function()
local masked = guiEditIsMasked(password) -- check the edit box masked flag
outputChatBox("Edit field is " .. (masked and "masked" or "not masked")) -- show info about edit box
end)

See Also

GUI Functions