Hello all,

so recently I've been trying out many of the scripts from the stickies and discovered a couple things.

(1) this is probably an error on my part and I just need some help regarding it.

I'm trying to make it so I can secure the "diamond" from the diamond heist dlc mission. I already use this exact same code to secure a bag of meth and it works perfectly fine, however I cannot get it to work with the diamond. I have looked in the update 70 carrytweakdata.lua and got the bag name 'hope_diamond' but when inserting it into the script it doesn't work.


Code:

function secure(name)
managers.loot:secure( name, managers.money:get_bag_value( name ) )
end
secure("hope_diamond")

-- Message on screen
if managers.hud then
managers.hud:show_hint({text = "Loaded tester.lua, congrats you didn't break it."})
end







(2) and one more script.

I'm trying to use SirGoodSmoke's Updated Spawn/Give Bag Functions script, and when I use it, it simply doesn't work. I know its a function only and you have to tell it what bag you want it to spawn so I tried doing that based off some of the replies to the thread and got this:


Code:

--SPAWN BAG FUNCTION
function ServerSpawnBag(name, zipline_unit)
if not alive (managers.player:player_unit()) then return end
local camera_ext = managers.player:player_unit():camera()
local carry_data = tweak_data.carry[ name ]
local dye_initiated = carry_data.dye_initiated
local has_dye_pack = carry_data.has_dye_pack
local dye_value_multiplier = carry_data.dye_value_multiplier
if Network:is_client() then
managers.network:session():send_to_host("server_dr op_carry", name, carry_data.multiplier, carry_data.dye_initiated, carry_data.has_dye_pack, carry_data.dye_value_multiplier, camera_ext:position(), camera_ext:rotation(), camera_ext:forward(), Vector3(0, 0, 0), zipline_unit)
else
managers.player:server_drop_carry(name, carry_data.multiplier, carry_data.dye_initiated, carry_data.has_dye_pack, carry_data.dye_value_multiplier, camera_ext:position(), camera_ext:rotation(), camera_ext:forward(), Vector3(0, 0, 0), zipline_unit, managers.network:session():local_peer():id())
end
end
--BAG NAME
spnturret = spnturret or function()
ServerSpawnBag("painting")
end
spnturret()
-- MESSAGE ON SCREEN
if managers.hud then
managers.hud:show_hint( { text = "Spawned Painting" } )
end







I'm curious if there is something wrong regarding the script such as the new update broke it, or whether or not I'm just flat out not doing it right. I have it set to a keybind on F1 using VK_F1




Credits
@SirGoodSmoke for Spawn Bags script


Original Writen by epicman987 in Payday 2 Category, the date of 26-06-2015 23:41.