> For the complete documentation index, see [llms.txt](https://docs.lockcode.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lockcode.com.br/compilacao/compilador-de-scripts-avancado/variaveis-de-ambiente-envs/como-definir-variaveis-envs.md).

# Como Definir Variáveis Envs

### Para Desenvolvedores (Apenas o Criador da Resource)

Como desenvolvedor, você define as variáveis para controlar sua resource globalmente. Essas configurações se aplicam a **TODOS os servidores** que usam sua resource.

**Exemplo:** Desenvolvedor de Sistema de Caminhoneiro

```
SYSTEM_ENABLED = "true"           // Ativar/desativar globalmente
VERSION_MIN_REQUIRED = "2.1"     // Versão mínima do servidor
FEATURE_BONUS_ACTIVE = "false"    // Desabilitar temporariamente feature
DEBUG_MODE = "false"              // Logs de debug globais
PROTECTION_LEVEL = "2"            // Nível de proteção
```

### Tipos de Dados Suportados

⚠️ **IMPORTANTE**: Todas as variáveis são armazenadas e retornadas como **strings**.

```lua
-- ✅ Exemplos reais de controle de resource pelo desenvolvedor
SYSTEM_ENABLED = "true"           -- Ativar/desativar resource globalmente
FEATURE_ADVANCED = "false"        -- Controlar features específicas
DEBUG_MODE = "false"              -- Logs de debug globais
SECURITY_LEVEL = "2"              -- Nível de proteção

-- ❌ Todos os valores são strings, mesmo que representem outros tipos
SECURITY_LEVEL = 2                -- Será convertido para "2"
SYSTEM_ENABLED = true             -- Será convertido para "true"
VERSION_REQUIRED = 2.1            -- Será convertido para "2.1"
```

### Boas Práticas de Nomenclatura

```lua
-- ✅ Variáveis para controle da resource pelo desenvolvedor
SYSTEM_ENABLED = "true"               -- Kill switch geral
FEATURE_PREMIUM_ACTIVE = "false"      -- Controlar features premium
MAINTENANCE_MODE = "false"            -- Modo manutenção global
SECURITY_ANTI_CRACK = "true"          -- Proteção anti-crack
DEBUG_VERBOSE_LOGS = "false"          -- Logs detalhados
VERSION_MIN_REQUIRED = "1.5.0"        -- Versão mínima aceita

-- ❌ Evitar - nomes genéricos que confundem com config de servidor
ENABLED = "true"                      -- Muito genérico
VER = "1.5"                          -- Muito curto
MODE = "debug"                        -- Confuso
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lockcode.com.br/compilacao/compilador-de-scripts-avancado/variaveis-de-ambiente-envs/como-definir-variaveis-envs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
