# Macros

<table data-full-width="false"><thead><tr><th width="260">Macro</th><th width="490">Information</th></tr></thead><tbody><tr><td><pre class="language-luau"><code class="lang-luau">LP_BLACKLIST(&#x3C;string>)
</code></pre></td><td>Blacklists the current user/HWID with the provided reason.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_INIT(&#x3C;function>)
</code></pre></td><td>Any closure ran inside this runs before the main authentication logic, can be used for running anticheat bypasses before LuaProt.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_VMIFY(&#x3C;function>)
</code></pre></td><td>Virtualize the input function, improving its obfuscation. This reduces performance by a lot due to it running a VM inside a VM.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_ENCSTR(&#x3C;string>)
</code></pre></td><td>Applies string manipulation to the input string to hide it from constant dumps.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_DASHBOARD:Connect(&#x3C;string>, &#x3C;function>)
</code></pre></td><td>Connect to a user dashboard component. This can be used to handle toggles like enabling/disabling autofarm settings.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_DASHBOARD:Fire(&#x3C;string>, &#x3C;number, string, boolean>)
</code></pre></td><td>Update a user dashboard component. This can be used to display autofarming stats on their dashboard.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_SAVE_VALUE(&#x3C;id: string>, &#x3C;value: number, string, boolean>, &#x3C;overwrite: boolean>)
</code></pre></td><td>Update a storage value of a key or hwid. This can be used for cloud-configs and saving stats like total kills in a shooter game.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_GET_VALUE(&#x3C;id: string>)
</code></pre></td><td>Fetch a storage value of a key or hwid. This can be used for cloud configs and getting saved stats like total kills in a shooter game.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_DELETE_VALUE(&#x3C;id: string>)
</code></pre></td><td>Delete a storage value of a key or hwid. Use this when you do not need the storage value anymore.</td></tr><tr><td><pre class="language-luau"><code class="lang-luau">LP_SECURE_REQUEST(&#x3C;data>)
</code></pre></td><td>Send an E2E encrypted request through our proxy server to prevent HTTP spies of any kind. Please know this does not make it impossible, it makes it a lot harder for attackers.</td></tr></tbody></table>

### Examples

<details>

<summary>How to use LP_BLACKLIST</summary>

```luau
LP_BLACKLIST("Hello, world!") -- LP_BLACKLIST accepts 1 single constant string
```

</details>

<details>

<summary>How NOT to use LP_BLACKLIST</summary>

```luau
LP_BLACKLIST("Hello, world" .. "!") -- LP_BLACKLIST accepts 1 single constant string
```

```luau
local blacklistReason = "Hello, world!"
LP_BLACKLIST(blacklistReason) -- LP_BLACKLIST accepts 1 single constant string
```

```luau
LP_BLACKLIST(1234567890) -- LP_BLACKLIST accepts 1 single constant string
```

</details>

***

<details>

<summary>How to use LP_INIT</summary>

{% code fullWidth="false" %}

```luau
LP_INIT(function()
    print("Hello, world!")
end) -- You should NOT call this
```

{% endcode %}

```luau
LP_INIT(function()
    print("Hello, world! 1")
end)

LP_INIT(function()
    print("Hello, world! 2")
end) -- You are allowed to have multiple in your file, they will all run
```

</details>

<details>

<summary>How NOT to use LP_INIT</summary>

{% code fullWidth="false" %}

```luau
LP_INIT(function()
    print("Hello, world!")
end)() -- You should NOT call this
```

{% endcode %}

```luau
local myFunction = function()
    print("Hello, world!")
end

LP_INIT(myFunction) -- LP_INIT accepts a single constant function as argument
```

```luau
local myUpvalue = "Hello, world!"
LP_INIT(function()
    print(myUpvalue)
end) -- LP_INIT does not support upvalues
```

```luau
local initMacro = LP_INIT(function()
    print("Hello, world!")
end) -- LP_INIT does not return anything
```

</details>

***

<details>

<summary><strong>How to use LP_VMIFY</strong></summary>

```luau
LP_VMIFY(function()
    print("Hello, world!")
end)() -- Call the function
```

```luau
local MyEvent = Instance.new("BindableEvent")
MyEvent.Event:Connect(LP_VMIFY(function(...)
    print("Hello, world!")
end)) -- Connect it to something
```

</details>

<details>

<summary><strong>How NOT to use LP_VMIFY</strong></summary>

```luau
LP_VMIFY(function()
    print("Hello, world!")
end) -- LP_VMIFY does NOT call the function!
```

```luau
local myFunction = function()
    print("Hello, world!")
end

LP_VMIFY(myFunction) -- LP_VMIFY expects a single function constant
```

</details>

***

<details>

<summary>How to use LP_ENCSTR</summary>

```luau
LP_ENCSTR("Hello, world!") -- LP_ENCSTR accepts 1 single constant string
```

</details>

<details>

<summary>How NOT to use LP_ENCSTR</summary>

```luau
LP_ENCSTR("Hello, world" .. "!") -- LP_ENCSTR accepts 1 single constant string
```

```luau
local saferString = "Hello, world!"
LP_ENCSTR(saferString) -- LP_ENCSTR accepts 1 single constant string
```

```luau
LP_ENCSTR(1234567890) -- LP_ENCSTR accepts 1 single constant string
```

</details>

***

<details>

<summary>How to use LP_DASHBOARD:Connect</summary>

```luau
LP_DASHBOARD:Connect("mySlider", function(data)
    print("Slider value from dashboard:", data)
end)
```

```luau
LP_DASHBOARD:Connect("myTextInput", function(data)
    print(data)
end)
```

```luau
local myCallback = function()
    print("Hello, world!")
end

LP_DASHBOARD:Connect("myButton", myCallback)
```

<pre class="language-luau"><code class="lang-luau">local myConnection = LP_DASHBOARD:Connect("myTextInput", function(data)
    print(data<a data-footnote-ref href="#user-content-fn-1">)</a>
end)

task.wait(10)
myConnection:Disconnect() -- Disconnects the connection
</code></pre>

</details>

<details>

<summary>How NOT to use LP_DASHBOARD:Connect</summary>

```luau
LP_DASHBOARD:Connect(function(data)
    print("Hello, world!")
end) -- LP_DASHBOARD:Connect requires both string and a callback as argument
```

```luau
LP_DASHBOARD:Connect("myTextInput") -- LP_DASHBOARD:Connect requires both string and a callback as argument
```

</details>

***

<details>

<summary>How to use LP_DASHBOARD:Fire</summary>

```luau
LP_DASHBOARD:Fire("myInfo", "Hello, world!") -- or any string
```

```luau
LP_DASHBOARD:Fire("myToggle", true) -- or false
```

```luau
LP_DASHBOARD:Fire("myStat", 123) -- or any valid number
```

```luau
LP_DASHBOARD:Fire("walkSpeedSlider", Humanoid.WalkSpeed) -- anything that returns a string, number or boolean
```

</details>

<details>

<summary>How NOT to use LP_DASHBOARD:Fire</summary>

```luau
LP_DASHBOARD:Fire("myInfo") -- Fire expects 2 arguments
```

```luau
local myConnection = LP_DASHBOARD:Connect(...)
myConnection:Fire("myToggle", true) -- it must be LP_DASHBOARD:Fire
```

</details>

***

<details>

<summary>How to use LP_SAVE_VALUE</summary>

```luau
LP_SAVE_VALUE("myStorageId", "Hello, world!", true) -- The last argument is overwrite, this for example will overwrite myStorageId if it already exists
```

```luau
LP_SAVE_VALUE("aStoredNumber", 1234) -- Can also be just 2 arguments, if it exists it wont update the storage value
```

```luau
LP_SAVE_VALUE("aStoredBoolean", true, false)
```

```luau
local success, error = LP_SAVE_VALUE("aStoredBoolean", true, false)
if not success then -- example error here if "aStoredBoolean" already exists would be "Storage entry already exists."
    warn("Failed to save value to storage!", error)
end
```

```luau
local scriptSettings = {
    Aimbot = {
        Enabled = true,
        Mode = "Mouse",
        FOV = {
            Enabled = true,
            Size = 45,
            Color = { -- JSONEncode does not support something like a Color3
                R = 0,
                G = 0,
                B = 0
            }
        },
        Smoothing = {
            .... whatever
        }
    }
}

local encodedJSON = game:GetService("HttpService"):JSONEncode(scriptSettings)
local success, error = LP_SAVE_VALUE("cloudConfig-legit", encodedJSON, true)
if not success then
    warn("Failed to save config!")
else
    print("Saved config!")
end
```

</details>

<details>

<summary>How NOT to use LP_SAVE_VALUE</summary>

```luau
local success, error = LP_SAVE_VALUE("aStoredTable", {myIndex = 1234})
if not success then -- a table is an unsupported value type, convert it to JSON instead. 
    warn("Failed to save value to storage!", error)
end
```

```luau
LP_SAVE_VALUE(123) -- LP_SAVE_VALUE requires a string (storage id) as first argument
```

```luau
LP_SAVE_VALUE("aStorageKey") -- LP_SAVE_VALUE requires a string, number or boolean as second argument
```

</details>

***

<details>

<summary>How to use LP_GET_VALUE</summary>

```luau
LP_GET_VALUE("myStorageId") -- Will fetch whatever is connected to their key, connected to the storage id "myStorageId"
```

```luau
local success, response = LP_GET_VALUE("myStorageId")
if not success then -- example error here if "myStorageId" does not exist "Value not found."
    warn("Failed to get value from storage!", response)
end
```

```luau
local scriptSettings = {
    Aimbot = {
        Enabled = true,
        Mode = "Mouse",
        FOV = {
            Enabled = true,
            Size = 45,
            Color = {
                R = 0,
                G = 0,
                B = 0
            }
        },
        Smoothing = {
            .... whatever
        }
    }
}

local success, response = LP_GET_VALUE("cloudConfig-legit")
if not success then
    warn("Failed to get config!")
else
    print("Loading config!")
    
    -- Terrible way of loading configs but this is just an example
    scriptSettings = game:GetService("HttpService"):JSONDecode(response)
end
```

</details>

<details>

<summary>How NOT to use LP_GET_VALUE</summary>

```luau
local response = LP_GET_VALUE("myStoredValue")
print(response) -- This will print a boolean, LP_GET_VALUE returns 2 values, success (a boolean) and response (the value from storage or an error)
```

```luau
LP_GET_VALUE(123) -- LP_GET_VALUE requires a string (storage id) as first argument
```

</details>

***

<details>

<summary>How to use LP_GET_VALUE</summary>

```luau
LP_DELETE_VALUE("myStorageId") -- Will delete whatever is connected to their key with this storage id
```

```luau
local success, error = LP_DELETE_VALUE("myStorageId")
if not success then -- example error here if "myStorageId" does not exist "Value not found."
    warn("Failed to delete value from storage!", error)
end
```

```luau
local success, response = LP_DELETE_VALUE("cloudConfig-legit")
if not success then
    warn("Failed to delete config!", response)
else
    print("Deleted config!")
end
```

</details>

<details>

<summary>How NOT to use LP_GET_VALUE</summary>

```luau
local response = LP_DELETE_VALUE("myStoredValue")
print(response) -- This will print a boolean, LP_DELETE_VALUE returns 2 values, success (a boolean) and response (an error or Success)
```

```luau
LP_DELETE_VALUE(123) -- LP_DELETE_VALUE requires a string (storage id) as first argument
```

</details>

***

<details>

<summary>How to use LP_SECURE_REQUEST</summary>

{% hint style="info" %}
LP\_SECURE\_REQUEST is used the exact same way as the normal request function provided by scripting utilities. It supports all Method types including GET, POST, DELETE, PATCH
{% endhint %}

```luau
print(LP_SECURE_REQUEST({Url = "https://luaprot.net/"}).Body)
```

```luau
local response = LP_SECURE_REQUEST({
    Url = "https://discord.com/api/webhooks/",
    Method = "POST",
    Headers = {
        ["Content-Type"] = "application/json"
    },
    Body = {
        content = "Brizzy was here!",
    },
})

if response.StatusCode == 200 then
    print("Sent webhook message!")
else
    print("Failed to send message, status code:", response.StatusCode)
end
```

</details>

<details>

<summary>How NOT to use LP_SECURE_REQUEST</summary>

```luau
LP_SECURE_REQUEST() -- LP_SECURE_REQUEST requires a table as argument
```

```luau
LP_SECURE_REQUEST(123) -- LP_SECURE_REQUEST requires a table as argument
```

```luau
LP_SECURE_REQUEST({}) -- LP_SECURE_REQUEST requires a Url parameter in the table argument
```

</details>

[^1]:


---

# Agent Instructions: 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:

```
GET https://docs.luaprot.net/luaprot/macro-documentation/macros.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
