Explosive Cops - No host needed!

Posts 1–13 of 13 · Page 1 of 1
Explosive Cops - No host needed!
Finally, the hackers have won. The ultimate multiplayer script is here.
Cops and civs explode on death. Shooting bags into the air.
Can be turned on and off.

Code:
--Bouncing Betty Cops
--goes into any multiplayer game and blows up AI upon death
--no host needed

bags_amount = 4 --amount of bags to drop per death, dont recommend above the default. game slows down
bags_label = "ammo"

function bagspawn(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,-70 ), 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,-70 ), 0 )
	end
end

function CopActionHurt:on_death_drop( unit, stage )
	if spill == 1 then
		for i = 1, bags_amount do
			bagspawn(bags_label, self._unit:position(), 120)
		end
	end
	
	if self._weapon_dropped then
		return
	end
	
	if self._delayed_shooting_hurt_clbk_id then
		managers.enemy:remove_delayed_clbk( self._delayed_shooting_hurt_clbk_id )
		self._delayed_shooting_hurt_clbk_id = nil
	end
	
	if self._shooting_hurt then
		if stage == 2 then
			self._weapon_unit:base():stop_autofire()
			self._ext_inventory:drop_weapon()
			self._weapon_dropped = true
			self._shooting_hurt = false
		end
	elseif self._ext_inventory then
		self._ext_inventory:drop_weapon()
		self._weapon_dropped = true
	end
	return
end

if spill == 0 or spill == nil then
		spill = 1
	else if spill == 1 then
		spill = 0
	end
end
so the cops do actually literately explode?
And here I was thinking the dirty gold thing was evil - bravo, sir.
Overkill should add this as a gamemode.
So much win on this one, kudos!
You guys work fast. Found some reviews.

First time today I encountered someone hacking. it was an armoured truck heist and suddenly yellow bags flew up in the air and everything started exploding. destroying the armoured truck doors (and some of the loot). This happened maybe 3-4 times.

It was rather annoying but the offending party was quickly identified and kicked and everything stopped.
Hardest piece of hacking i encountered was those instantly finished drills for bank vaults and so on.
But that game with ammo bags from train heist, is quite something!
You are the best..for me is the best script ever..nice work dude,im looking for a script to turn off the mask in assault no host needed
I love this xD when people say "wtf happened here?" I just say "Terrorists dude they came back again!" haha, How do I make this so I can spawn the "shell" bags? Cant figure that out.

Also if you could make a script to make it so when people pick up like bags of weps or money it explodes xD
Quote Originally Posted by frostyshield View Post
How do I make this so I can spawn the "shell" bags? Cant figure that out.
there you go :

Code:
-- Add stuff in van

function secure(name)
        managers.loot:secure( name, managers.money:get_bag_value( name ) )
end
--secure("meth")
--secure("money")
--secure("gold")

-- Spawn bags
function get_crosshair_ray(penetrate, from_pos, mvec_to)
  local player_unit = managers.player:player_unit()
  local camera = player_unit:camera()
  if not penetrate then penetrate = false end
  if not mvec_to then mvec_to = Vector3() end
  if not from_pos then from_pos = camera:position() end
  mvector3.set( mvec_to, camera:forward() )
  mvector3.multiply( mvec_to, 20000 )
  mvector3.add( mvec_to, from_pos )
  local col_ray = World:raycast( "ray", from_pos, mvec_to, "slot_mask", managers.slot:get_mask( "bullet_impact_targets" ) )
  if col_ray then
      if penetrate then
          local offset = Vector3()
          mvector3.set(offset, camera:forward())
          mvector3.multiply(offset, 100)
          mvector3.add(col_ray.hit_position, offset)
      end
      return col_ray
  end
  return false
end
function get_crosshair_pos(penetrate, from_pos, mvec_to)
  local ray = get_crosshair_ray(penetrate, from_pos, mvec_to)
  if not ray then return false end
  return ray.hit_position
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

if managers.job:current_level_id() == "nightclub" or managers.job:current_level_id() == "welcome_to_the_jungle_1" or managers.job:current_level_id() == "watchdogs_1" or managers.job:current_level_id() == "watchdogs_2" then
	spawn_loot("coke", get_crosshair_pos(), 120)
	--secure("coke")
end

if managers.job:current_level_id() == "branchbank" or managers.job:current_level_id() == "firestarter_3" then
	spawn_loot("money", get_crosshair_pos(), 120)
	spawn_loot("gold", get_crosshair_pos(), 120)

end

if managers.job:current_level_id() == "firestarter_2" then
	spawn_loot("money", get_crosshair_pos(), 120)
	spawn_loot("gold", get_crosshair_pos(), 120)
	spawn_loot("coke", get_crosshair_pos(), 120)
end

if managers.job:current_level_id() == "alex_1" then
	spawn_loot("meth", get_crosshair_pos(), 120)
end

if managers.job:current_level_id() == "alex_3" then
spawn_loot("money", get_crosshair_pos(), 120)
end

if managers.job:current_level_id() == "arm_cro" or managers.job:current_level_id() == "arm_und" or managers.job:current_level_id() == "arm_hcm" or managers.job:current_level_id() == "arm_par" or managers.job:current_level_id() == "arm_fac" then
spawn_loot("gold", get_crosshair_pos(), 120)
end

if managers.job:current_level_id() == "arm_for" then
spawn_loot("ammo", get_crosshair_pos(), 120)
--spawn_loot("turret", get_crosshair_pos(), 120)
--spawn_loot("lance_bag", get_crosshair_pos(), 120)
end


spawn_loot("ammo", get_crosshair_pos(), 400)
--spawn_loot("meth", get_crosshair_pos(), 120)
--spawn_loot("gold", get_crosshair_pos(), 120)
--spawn_loot("money", get_crosshair_pos(), 120)
--spawn_loot("coke", get_crosshair_pos(), 120)
--spawn_loot("weapons", get_crosshair_pos(), 120)
--spawn_loot("lance_bag", get_crosshair_pos(), 120)
--spawn_loot("painting", get_crosshair_pos(), 120)
--spawn_loot("circuit", get_crosshair_pos(), 120)
--spawn_loot("engine_XX", get_crosshair_pos(), 120) -- 01-12
--spawn_loot("person", get_crosshair_pos(), 120)
--spawn_loot("special_person", get_crosshair_pos(), 120)
Will drop a bag where you aim with the mouse. 4m will make the bag explode; loot bag drop code originally by dougbenham/transcend on UC, original spawn code by Simplity on UC. I just modified it to spawn bags instead of npc.
Quote Originally Posted by commie85 View Post
will drop a bag where you aim with the mouse. credit to Simplity on UC, i just modified it to spawn bags instead of npc. 4m will make the bag explode
man if you're going to credit someone, transcend/dougbenham originally came up with the bag spawning code and it's been modified by a bunch of other people including me.
Quote Originally Posted by ojsimpson View Post
man if you're going to credit someone, transcend/dougbenham originally came up with the bag spawning code and it's been modified by a bunch of other people including me.
done
iv tried the code add stuff in the van..but dosnt work...there is something tha ti have to do? like change a name of the script..
Not working anymore :/
Posts 1–13 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?