# Install guide

1. Download the `esx_realistic_atm` resource.
2. Move the `esx_realistic_atm` folder into your server's `resources` directory.
3. Open your server configuration file (default: `server.cfg`)
4.  Add the following line to ensure the resource is started when the server runs:&#x20;

    ```
    ensure esx_realistic_atm
    ```
5. Remove/Modify your banking scripts that handle ATM opening or PIN code management (if using cached pincodes).
6. Start the server

esx\_banking:

Go to client/main.lua (\~line 17)

```lua
CreateThread(function ()
            while playerLoaded do
                data.coord = GetEntityCoords(data.ped)
                data.ped = PlayerPedId()
                bankPoints, atmPoints, markerPoints = {}, {}, {}

                if (IsPedOnFoot(data.ped) and not ESX.PlayerData.dead) and not inMenu then
                    for i = 1, #Config.AtmModels do
                        local atm = GetClosestObjectOfType(data.coord.x, data.coord.y, data.coord.z, 0.7, Config.AtmModels[i], false, false, false)
                        if atm ~= 0 then
                            atmPoints[#atmPoints+1] = GetEntityCoords(atm)
                        end
                    end

                    for i = 1, #Config.Banks do
                        local bankDistance = #(data.coord - Config.Banks[i].Position.xyz)
                        if bankDistance <= 0.7 then
                            bankPoints[#bankPoints+1] = Config.Banks[i].Position.xyz
                        end
                        if Config.ShowMarker and bankDistance <= (Config.DrawMarker or 10) then
                            markerPoints[#markerPoints+1] = Config.Banks[i].Position.xyz
                        end
                    end
                end

                if next(bankPoints) and not uiActive then
                    self:TextUi(true)
                end

                if next(atmPoints) and not uiActive then
                    self:TextUi(true, true)
                end

                if not next(bankPoints) and not next(atmPoints) and uiActive then
                    self:TextUi(false)
                end

                Wait(1000)
            end
        end)
```

Replace:

```lua
CreateThread(function ()
            while playerLoaded do
                data.coord = GetEntityCoords(data.ped)
                data.ped = PlayerPedId()
                bankPoints, markerPoints = {}, {}

                if (IsPedOnFoot(data.ped) and not ESX.PlayerData.dead) and not inMenu then
                    for i = 1, #Config.Banks do
                        local bankDistance = #(data.coord - Config.Banks[i].Position.xyz)
                        if bankDistance <= 0.7 then
                            bankPoints[#bankPoints+1] = Config.Banks[i].Position.xyz
                        end
                        if Config.ShowMarker and bankDistance <= (Config.DrawMarker or 10) then
                            markerPoints[#markerPoints+1] = Config.Banks[i].Position.xyz
                        end
                    end
                end

                if next(bankPoints) and not uiActive then
                    self:TextUi(true)
                end

                if not next(bankPoints) and uiActive then
                    self:TextUi(false)
                end

                Wait(1000)
            end
        end)
```

okokBanking (not tested yet):

* Remove NearATM() function. (client.lua)
* Remove the whole Citizen.CreateThread where used NearATM() function.
*

    <figure><img src="https://1032749803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JoELqbd8UNsnzDcJtMO%2Fuploads%2FcjYAIhMz6jeZtw3IKEEi%2Fimage.png?alt=media&#x26;token=0996b770-425a-43e8-a010-27dca1c441a1" alt=""><figcaption></figcaption></figure>
