# Realistic ATM

{% embed url="<https://www.youtube.com/watch?v=wzMrsTqAj9Q>" %}

{% hint style="success" %}
This script is compatible with **ESX and QB.**
{% endhint %}

{% hint style="warning" %}
This script requires the [**ox\_target**](https://overextended.dev/ox_target) or [**qb-target**](https://github.com/qbcore-framework/qb-target)
{% endhint %}

### Script

{% embed url="<https://forum.cfx.re/t/realistic-atm/5258642>" %}

### Installation

{% tabs %}
{% tab title="ESX" %}

1. Download from [keymaster](https://keymaster.fivem.net/login?return_url=/asset-grants) and **unzip** the `Realistic ATM` on desktop. Open **ESX** folder, and move `nv_atm` in your server's resource folder.
2. Add the resource to your server start config: `ensure nv_atm`, the name of the folder must not be changed or the resource will not function correctly. **Ensure the script is the latest one.**

{% code title="server.cfg" %}

```tsconfig
# ...
# All the other resources
ensure nv_atm
```

{% endcode %}

3. Open the **config.lua** and configure it correctly, paying attention to all the variables!
4. Restart server or type `ensure nv_atm` in **console.**
   {% endtab %}

{% tab title="QB" %}

1. Download from [keymaster](https://keymaster.fivem.net/login?return_url=/asset-grants) and **unzip** the `Realistic ATM` on desktop. Open **QB** folder, and move `nv_atm` in your server's resource folder.
2. Add the resource to your server start config: `ensure nv_atm`, the name of the folder must not be changed or the resource will not function correctly. **Ensure the script is the latest one.**

{% code title="server.cfg" %}

```tsconfig
# ...
# All the other resources
ensure nv_atm
```

{% endcode %}

3. Open the **config.lua** and configure it correctly, paying attention to all the variables!
4. Restart server or type `ensure nv_atm` in **console.**
   {% endtab %}
   {% endtabs %}

### Code

{% tabs %}
{% tab title="config.lua" %}

```lua
config = {}

config.notifyName = "Fleeca Bank"
config.notifyDesc = "ATM Machine"
config.notifyIcon = "CHAR_BANK_FLEECA"
config.enableNotification = false

config.atmModels = {
	"prop_atm_01",
	"prop_atm_02",
	"prop_atm_03",
	"prop_fleeca_atm"
}

config.msg_deposit1 = "You don't have enough money."
config.msg_deposit2 = {"You are successfully deposit $","to bank."}

config.msg_withdraw1 = "You don't have enough money."
config.msg_withdraw2 = {"You are successfully withdraw $","from bank."}

config.atm_lang = {
	welcome_title = "Welcome to",
	title="FL<b>EE</b>CA BANK",
	insert_card="Insert a card",

	balance="Balance",
	withdraw="Withdrawal",
	deposit="Deposit",
	exit="Exit",
	back="Back",
	custom_input="Custom Input",
	msg_balance="Your Balance",
	
	msg_deposit="How much money you want to deposit?",
	msg_withdraw="How much money you want to withdraw?",

	msg_thanks = "Thanks for using our services",
	msg_soon = "See you soon!"

}

-- If you want to enable QB Target, you can set this to true
config.qbtarget = false 
config.qbtarget_name = "Open ATM"

-- If you want to enable OX Target, you can set this to true
config.ox_target = false 
config.ox_target_name = "Open ATM"
```

{% endtab %}

{% tab title="events.txt" %}

```lua
RegisterNetEvent("nv_atm:client:open",function()
	--print("ATM is opened")
end)

RegisterNetEvent("nv_atm:client:close",function()
	--print("ATM is closed")
end)

RegisterNetEvent("nv_atm:client:deposit",function(money)
	--print("Player deposit: "..money)
end)

RegisterNetEvent("nv_atm:client:withdraw",function(money)
	--print("Player withdraw: "..money)
end)
```

{% endtab %}
{% endtabs %}

### Support

{% hint style="info" %}
If you have any problems or need help, contact us on [Discord!](https://discord.gg/NeveraDev/tw28AqrgWU)
{% endhint %}
