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)