# outsider\_needs

{% hint style="danger" %}
you must ensure this script **before the script** you want to use this API on
{% endhint %}

<details>

<summary>GETTERS</summary>

```lua
-- CLIENT
-- get data from client
local result = exports.outsider_needs:GetNeedsData()
print(json.encode(result,{ident = true}))

--SERVER
-- get data from server side
 local data = Core.Callback.TriggerAwait("Outsider_Needs:GetData", source)
 print(json.encode(data {ident = true}))

```

</details>

<details>

<summary>SETTERS</summary>

<pre class="language-lua"><code class="lang-lua"><strong>
</strong>--CLIENT
-- data only define what you want
local data = {
    AddThirst = 10,
    AddHunger = 10,
    AddStress = 10,
    AddAddiction = 10,
    RemoveThirst = 10,
    RemoveHunger = 10,
    RemoveStress = 10,
    RemoveAddiction = 10,
    SetBodyTemp = { cool = 10, hot = 10 }
}

-- set data client side
exports.outsider_needs:SetNeedsData(data)


-- SERVER
-- set data from server side
Core.Callback.TriggerAwait("outsider_needs:SetData",source,data)

</code></pre>

</details>

<details>

<summary>DIRTY SYSTEM</summary>

```lua
--to clean for the dirty system
TriggerEvent("Outsider_needs:Client:ClearDirt")
```

</details>

{% code fullWidth="true" %}

```lua
-- CLIENT CUSTOM
--this file is found in the script where these functions are available

-- Getters
local currentHunger = GetCurrentHunger()
local currentThirst = GetCurrentThirst()
local currentStress = GetCurrentStress()
local currentAddiction = GetCurrentAddiction()
local currentStressLevel = GetCurrentStressLevel()
local currentAddictionLevel = GetCurrentAddictionLevel()
local BodyTemp = GetCurrentBodyTemp()
print(BodyTemp.cool, BodyTemp.hot)

-- SETTERS
RemoveThirst(value)
RemoveHunger(value)
RemoveStress(value)
RemoveAddiction(value)
AddStress(value)
AddAddiction(value)
AddThirst(value)
AddHunger(value)
SetBodyTemp({ cool = 0, hot = 0 }) -- this is incremental only add or remove wat you want if you add 4 and cool is 10 then it will be 14

```

{% endcode %}


---

# 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://outsider-scripts.gitbook.io/midnight-code/api-reference/outsider_needs.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.
