Hello all
I hope for help
I have a map I’m trying to make a steal on
And I have it in the map itself
ch_prop_gold_trolly_01a
ch_prop_ch_cash_trolly_01c
I want to steal these tables
With the movements
All my attempts are unsuccessful
And see examples of all software makers
They spawn these tables
But I already have assets that I do not need to spawn
Can you help with the code
Or function
any one help me ?
There is an ESX resource that has this functionality and allows editing:
https://github.com/utkuali/pacificheist-ESX-
If you have already spawned trolleys you can replace the coordinates in the Loot function to point to where your trolleys are, and change the payout events.
I will try thank you
All my attempts failed
for example
i have in coords -481.8058, 4.0055465, 36.428459
ch_prop_gold_trolly_01a Already exists without spawn Is on the map
Is there a method or a code
For the way to rob this ?
im step here
Problems appeared
For example, when gold is obtained, it does not disappear from the table
im using this
mWojtasik.dev - Object Viewer
mWojtasik.dev - Object Viewer
mWojtasik.dev - Object Viewer
this command for run
RegisterCommand(“testgold”, function()
RequestModel(GetHashKey(“ch_prop_gold_trolly_01b”))
while not HasModelLoaded(GetHashKey(“ch_prop_gold_trolly_01b”)) do
Citizen.Wait(1)
end
– Trolley1 = CreateObject(1477056029, -481.4025, 3.0543808, 36.428375, 0, 0, 0)
Loot(3)
end)
function Loot(currentgrab)
Grab2clear = false
Grab3clear = false
UTK.grabber = true
Trolley = nil
local ped = PlayerPedId()
if currentgrab == 1 then
Trolley = GetClosestObjectOfType(-481.8058, 1.5718128, 36.428096, 1.0, 1984778915, false, false, false)
model = "ch_prop_vault_dimaondbox_01a"
elseif currentgrab == 2 then
Trolley = GetClosestObjectOfType(-485.4012, -3.841431, 36.427322, 1.0, 723403433, false, false, false)
model = "hei_prop_heist_cash_pile"
elseif currentgrab == 3 then
Trolley = GetClosestObjectOfType(-484.5771, 5.3336291, 36.428485, 1.0, 1078712918, false, false, false)
model = "ch_prop_gold_bar_01a"
end
local CashAppear = function()
local pedCoords = GetEntityCoords(ped)
local grabmodel = GetHashKey(model)
RequestModel(grabmodel)
while not HasModelLoaded(grabmodel) do
Citizen.Wait(100)
end
local grabobj = CreateObject(grabmodel, pedCoords, true)
FreezeEntityPosition(grabobj, true)
SetEntityInvincible(grabobj, true)
SetEntityNoCollisionEntity(grabobj, ped)
SetEntityVisible(grabobj, false, false)
AttachEntityToEntity(grabobj, ped, GetPedBoneIndex(ped, 60309), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 0, true)
local startedGrabbing = GetGameTimer()
Citizen.CreateThread(function()
while GetGameTimer() - startedGrabbing < 37000 do
Citizen.Wait(1)
DisableControlAction(0, 73, true)
if HasAnimEventFired(ped, GetHashKey("CASH_APPEAR")) then
if not IsEntityVisible(grabobj) then
SetEntityVisible(grabobj, true, false)
end
end
if HasAnimEventFired(ped, GetHashKey("RELEASE_CASH_DESTROY")) then
if IsEntityVisible(grabobj) then
SetEntityVisible(grabobj, false, false)
if currentgrab < 4 then
TriggerServerEvent("utk_oh:rewardCash")
elseif currentgrab == 4 then
TriggerServerEvent("utk_oh:rewardGold")
elseif currentgrab == 5 then
TriggerServerEvent("utk_oh:rewardDia")
end
end
end
end
DeleteObject(grabobj)
end)
end
local emptyobj = 769923921
-- if currentgrab == 4 or currentgrab == 5 then
-- emptyobj = 2714348429
-- end
if currentgrab == 1 then
emptyobj = 881130828
elseif currentgrab == 2 then
emptyobj = 881130828
elseif currentgrab == 3 then
emptyobj = 2714348429
end
if IsEntityPlayingAnim(Trolley, "anim@heists@ornate_bank@grab_cash", "cart_cash_dissapear", 3) then
return
end
local baghash = GetHashKey("hei_p_m_bag_var22_arm_s")
RequestAnimDict("anim@heists@ornate_bank@grab_cash")
RequestModel(baghash)
RequestModel(emptyobj)
while not HasAnimDictLoaded("anim@heists@ornate_bank@grab_cash") and not HasModelLoaded(emptyobj) and not HasModelLoaded(baghash) do
Citizen.Wait(100)
end
while not NetworkHasControlOfEntity(Trolley) do
Citizen.Wait(1)
NetworkRequestControlOfEntity(Trolley)
end
GrabBag = CreateObject(GetHashKey("hei_p_m_bag_var22_arm_s"), GetEntityCoords(PlayerPedId()), true, false, false)
Grab1 = NetworkCreateSynchronisedScene(GetEntityCoords(Trolley), GetEntityRotation(Trolley), 2, false, false, 1065353216, 0, 1.3)
NetworkAddPedToSynchronisedScene(ped, Grab1, "anim@heists@ornate_bank@grab_cash", "intro", 1.5, -4.0, 1, 16, 1148846080, 0)
NetworkAddEntityToSynchronisedScene(GrabBag, Grab1, "anim@heists@ornate_bank@grab_cash", "bag_intro", 4.0, -8.0, 1)
SetPedComponentVariation(ped, 5, 0, 0, 0)
NetworkStartSynchronisedScene(Grab1)
Citizen.Wait(1500)
CashAppear()
if not Grab2clear then
Grab2 = NetworkCreateSynchronisedScene(GetEntityCoords(Trolley), GetEntityRotation(Trolley), 2, false, false, 1065353216, 0, 1.3)
NetworkAddPedToSynchronisedScene(ped, Grab2, "anim@heists@ornate_bank@grab_cash", "grab", 1.5, -4.0, 1, 16, 1148846080, 0)
NetworkAddEntityToSynchronisedScene(GrabBag, Grab2, "anim@heists@ornate_bank@grab_cash", "bag_grab", 4.0, -8.0, 1)
NetworkAddEntityToSynchronisedScene(Trolley, Grab2, "anim@heists@ornate_bank@grab_cash", "cart_cash_dissapear", 4.0, -8.0, 1)
NetworkStartSynchronisedScene(Grab2)
Citizen.Wait(37000)
end
if not Grab3clear then
Grab3 = NetworkCreateSynchronisedScene(GetEntityCoords(Trolley), GetEntityRotation(Trolley), 2, false, false, 1065353216, 0, 1.3)
NetworkAddPedToSynchronisedScene(ped, Grab3, "anim@heists@ornate_bank@grab_cash", "exit", 1.5, -4.0, 1, 16, 1148846080, 0)
NetworkAddEntityToSynchronisedScene(GrabBag, Grab3, "anim@heists@ornate_bank@grab_cash", "bag_exit", 4.0, -8.0, 1)
NetworkStartSynchronisedScene(Grab3)
NewTrolley = CreateObject(emptyobj, GetEntityCoords(Trolley) + vector3(0.0, 0.0, - 0.985), true, false, false)
SetEntityRotation(NewTrolley, GetEntityRotation(Trolley))
while not NetworkHasControlOfEntity(Trolley) do
Citizen.Wait(1)
NetworkRequestControlOfEntity(Trolley)
end
DeleteObject(Trolley)
while DoesEntityExist(Trolley) do
Citizen.Wait(1)
DeleteObject(Trolley)
end
PlaceObjectOnGroundProperly(NewTrolley)
end
Citizen.Wait(1800)
if DoesEntityExist(GrabBag) then
DeleteEntity(GrabBag)
end
SetPedComponentVariation(ped, 5, 45, 0, 0)
RemoveAnimDict("anim@heists@ornate_bank@grab_cash")
SetModelAsNoLongerNeeded(emptyobj)
SetModelAsNoLongerNeeded(GetHashKey("hei_p_m_bag_var22_arm_s"))
end
any one help me?
hello im wait you
Hi, i’ve the same problem. What artifacts do you have?