[Code-Snippet] Pacific Bank Vault open animation + sound

Hello, these are the vault door opening animation and sound events I use in my pacific bank heist script, maybe this could be useful for you. It’s very simple actually.
Video: https://streamable.com/6995d

Code
RegisterNetEvent("vaultanim") -- vault door done
AddEventHandler("vaultanim", function()
    local doorcoords = {253.92, 224.56, 101.88}
    local obj = ESX.Game.GetClosestObject("v_ilev_bk_vaultdoor", doorcoords)
    local count = 0
    repeat
      local rotation = GetEntityHeading(obj) - 0.05
      SetEntityHeading(obj,rotation)
      count = count + 1
      Citizen.Wait(10)
    until count == 750
    FreezeEntityPosition(obj, true)
end)

RegisterNetEvent("vaultsound")
AddEventHandler("vaultsound", function()
    local sescount = 0
    repeat
      PlaySoundFrontend(-1,"OPENING", "MP_PROPERTIES_ELEVATOR_DOORS" ,1)
      Citizen.Wait(900)
      sescount = sescount + 1
    until sescount == 11
end)
Example usage
RegisterNetEvent('hackfinished')
AddEventHandler('hackfinished', function()
    local laptopchanse = math.random(1,10)
    if laptopchanse ~= 9 then
        exports['mythic_notify']:SendAlert("success", "Hack başarılı.")
        TriggerServerEvent('vaultanim') -- animation
        TriggerServerEvent('vaultsound') -- sound
    else
        exports['mythic_notify']:SendAlert("success", "Hack başarılı, ancak laptopun bozuldu.")
        TriggerServerEvent('vaultanim') -- animation
        TriggerServerEvent('vaultsound') -- sound
        TriggerServerEvent("breaklaptop")
    end
end)
7 Likes

Hello thank you very much for sharing this script merry christmas

1 Like

how can i install, i hope you give me a specific tutorial

just put it in your resource (client side) and trigger it whenever you want it, I put on an example

Do I have to create a new resource or use my old resource?

no you don’t have to create a new resource, just add it to resource you want to use

Thank you very much, I will try that

Any fix to this: https://gyazo.com/8fae83b1ecf849831e464ec4ef8e96d9

Code:

RegisterNetEvent("vaultanim") -- vault door done
AddEventHandler("vaultanim", function(v)
    print(v.x, v.y, v.z, v.hash)
    local doorcoords = {v.x, v.y, v.z}
    local obj = ESX.Game.GetClosestObject(v.hash, doorcoords)
    local count = 0
    repeat
      local rotation = GetEntityHeading(obj) - 0.05
      SetEntityHeading(obj,rotation)
      count = count + 1
      Citizen.Wait(10)
    until count == 750
    FreezeEntityPosition(obj, true)
end)

RegisterNetEvent("vaultsound")
AddEventHandler("vaultsound", function()
    local sescount = 0
    repeat
      PlaySoundFrontend(-1,"OPENING", "MP_PROPERTIES_ELEVATOR_DOORS" ,1)
      Citizen.Wait(900)
      sescount = sescount + 1
    until sescount == 11
end)
v.hash = "prop_ld_int_safe_01"

and v.hash should be like GetHashKey(“prop_ld_int_safe_01”)
local obj = GetClosestObjectOfType(v.x, v.y, v.z, 1.5, v.hash, false, false, false)

replace it with ESX.Game function

Nice, now work, thanks a lot!

Hello guys I want to add in my server the sound of ‘anim@heists@fleeca_bank@drilling’ when I start to use it is there a way to do it please ?

How is the animation done?

Thanks for sharing this one. I’ve been looking for this so I can go on with my script.:handshake::rocket:

Also how did you do that with the bruteforce? Is that hard to create or is there an export for that?