Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Payday 2] [SCRIPT] Test my special Bank Heist (super-hard mode) (Tutorial)
1
? [SCRIPT] Test my special Bank Heist (super-hard mode)

Game: Payday 2

Details

Run this after you're in-game on any Bank Heist job. It should work on multiplayer as well if you're hosting, perfect for trolling.

Your goals:

1) Rough up a few civilians.

2) Break into the vault and claim your reward.

Script:

Code:

Code:
function find_computer() local units = World:find_units_quick( "all" ) for i,unit in ipairs( units ) do if unit.interaction and unit:interaction() and unit:interaction().tweak_data == "computer_test" then return unit end end end function spawn_loot(type, _position, z_offset) local position = mvector3.copy(_position) if z_offset then mvector3.set_z(position, position.z + z_offset) end if Network:is_client() then managers.network:session():send_to_host( "server_drop_carry", type, managers.money:get_bag_value( type ), nil, nil, 0, position, Rotation( math.UP, math.random() * 360 ), Vector3( 0,0,0 ), 0 ) else managers.player:server_drop_carry( type, managers.money:get_bag_value( type ), nil, nil, 0, position, Rotation( math.UP, math.random() * 360 ), Vector3( 0,0,0 ), 0 ) end end function spawn(position, rotation) local unit_name = Idstring( "units/payday2/characters/ene_bulldozer_1/ene_bulldozer_1" ) local spawn_ai = { init_state = "idle" } local unit = World:spawn_unit( unit_name, position, rotation ) unit:base().made_of_gold = true unit:movement():set_character_anim_variables() unit:brain():set_spawn_ai( spawn_ai ) unit:brain():set_active( true ) end function spawn_cluster(position, num, cluster) for i=1,num do spawn(Vector3(position.x + (math.random() * cluster * 2 - cluster), position.y + (math.random() * cluster * 2 - cluster), position.z), Rotation( math.UP, math.random() * 360 )) end end if not _deadCop then _deadCop = CopDamage.die end function CopDamage:die( variant ) if self._unit:base().made_of_gold then spawn_loot("gold", self._unit:position(), 120) end return _deadCop(self, variant) end if not _drillDone then _drillDone = Drill.done end function Drill:done() local result = _drillDone(self) if managers.job:current_level_id() == "branchbank" then local computer = find_computer() if computer and computer:position().x == -1281 then spawn_cluster(Vector3(-2068.93, 2197.47, 1.1), 3, 100) spawn_cluster(Vector3(-2222.62, 2285.03, 1.1), 3, 100) elseif computer and computer:position().x == -2920 then spawn_cluster(Vector3(-2246.11, 2061.04, 1.1), 3, 100) spawn_cluster(Vector3(-2175.62, 2285.41, 1.1), 3, 100) end Drill.done = _drillDone _drillDone = nil end return result end if not _deadCiv then _deadCiv = CivilianDamage.die end function CivilianDamage:die( ... ) spawn(self._unit:position(), self._unit:rotation()) local result = _deadCiv( self, ... ) self._unit:set_slot( 0 ) managers.network:session():send_to_peers_synched( "remove_unit", self._unit ) return result end

Report back and let me know how your murderous exploits go!

Updates:

9/24/13 -- Dozers are made of gold now!

Preserved from the original MPGH tutorial for archival purposes.
Reply

Users browsing this thread:
3 Guest(s)


Forum Jump: