> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# setreadonly

> Sets whether a table is readonly and returns no values.

<div className="real-function-page">
  ```lua theme={null}
  setreadonly(target: table, readonly: boolean)
  ```

  ## Đối số

  <ParamField path={"target"} type={"table"} required>
    Table whose readonly status is changed.
  </ParamField>

  <ParamField path={"readonly"} type={"boolean"} required>
    Boolean readonly value to apply.
  </ParamField>

  ## Ví dụ

  Set a table's readonly flag to a specific boolean value.

  ```lua theme={null}
  local target = {}

  setreadonly(target, true)
  print(isreadonly(target))

  setreadonly(target, false)
  print(isreadonly(target))
  ```
</div>
