❗ Payday 2 How to Spawn Cloakers!!!??

Posts 1–15 of 26 · Page 1 of 2
❗ Payday 2 How to Spawn Cloakers!!!??
Hello,
I was just wondering if there is already a script or if someone can make a script that spawns Cloakers. I don't care if you make a script that spawns them whenever I press the toggle key (insert) or if they spawn in with other enemies, or if you replace say tazers with cloakers.
Also, is there anyway to modify the damage a special enemy can take before dieing? (cloaker, because he has very little health).
Thanks, let me know asap if you can!
Code:
 function FollowUnit()

local new_objective

local valid_criminals = {}
for pl_key, pl_record in pairs( managers.groupai:state():all_player_criminals() ) do
if pl_record.status ~= "dead" then
table.insert( valid_criminals, pl_key )
end
end

if #valid_criminals > 0 then
local follow_unit = managers.groupai:state():all_player_criminals()[ valid_criminals[ math.random( #valid_criminals ) ] ].unit -- pick a random player
new_objective = { 
type = "follow",
follow_unit = follow_unit,
scan = true,
is_default = true
}
end
return new_objective
end


function SpawnMob()

local spawn_point = managers.network:game():get_next_spawn_point()

local spawn_pos = spawn_point.pos_rot[1]
local spawn_rot = spawn_point.pos_rot[2]

local unit_name = Idstring( "units/payday2/characters/ene_spook_1/ene_spook_1" )
local myobjective = FollowUnit()

local spawn_ai = { 
init_state = "idle",
objective = myobjective
}

local unit = World:spawn_unit( unit_name, spawn_pos, spawn_rot )

unit:movement():set_character_anim_variables()


end
Quote Originally Posted by Skipsy View Post
Code:
 function FollowUnit()

local new_objective

local valid_criminals = {}
for pl_key, pl_record in pairs( managers.groupai:state():all_player_criminals() ) do
if pl_record.status ~= "dead" then
table.insert( valid_criminals, pl_key )
end
end

if #valid_criminals > 0 then
local follow_unit = managers.groupai:state():all_player_criminals()[ valid_criminals[ math.random( #valid_criminals ) ] ].unit -- pick a random player
new_objective = { 
type = "follow",
follow_unit = follow_unit,
scan = true,
is_default = true
}
end
return new_objective
end


function SpawnMob()

local spawn_point = managers.network:game():get_next_spawn_point()

local spawn_pos = spawn_point.pos_rot[1]
local spawn_rot = spawn_point.pos_rot[2]

local unit_name = Idstring( "units/payday2/characters/ene_spook_1/ene_spook_1" )
local myobjective = FollowUnit()

local spawn_ai = { 
init_state = "idle",
objective = myobjective
}

local unit = World:spawn_unit( unit_name, spawn_pos, spawn_rot )

unit:movement():set_character_anim_variables()


end
Just a quick question. What was this supposed to do? I put it in press insert and it activates the script but I don't see any cloakers spawn. DO they replace an enemy? Or when do they spawn? Please let me know.
Can anyone help?
Quote Originally Posted by sandman332 View Post
Can anyone help?
That code should spawn you a teammate cloaker, although I don't think it works. You should try asking @dougbenham
Quote Originally Posted by fapdarklord View Post


That code should spawn you a teammate cloaker, although I don't think it works. You should try asking @dougbenham
I already asked him. No response yet. I asked him yesterday. I just want to spawn enemy cloakers.
You are fucking desperate aren't you? Have some patience.

Its not difficult to spawn a spook. You spawn them the same way you would spawn any other unit. You just use their particular unit name instead. Here is some code that will spawn them whenever you kill a civilian.
Code:
function spawn(position, rotation)
	local unit_name = Idstring( "units/payday2/characters/ene_spook_1/ene_spook_1" )
	local spawn_ai = { init_state = "idle" }
	local unit = World:spawn_unit( unit_name, position, rotation )
	unit:movement():set_character_anim_variables()
	unit:brain():set_spawn_ai( spawn_ai )
	unit:brain():set_active( true )
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
Stop leeching so hard on this forum and try contributing back.
Quote Originally Posted by dougbenham View Post
You are fucking desperate aren't you? Have some patience.

Its not difficult to spawn a spook. You spawn them the same way you would spawn any other unit. You just use their particular unit name instead. Here is some code that will spawn them whenever you kill a civilian.
Code:
function spawn(position, rotation)
	local unit_name = Idstring( "units/payday2/characters/ene_spook_1/ene_spook_1" )
	local spawn_ai = { init_state = "idle" }
	local unit = World:spawn_unit( unit_name, position, rotation )
	unit:movement():set_character_anim_variables()
	unit:brain():set_spawn_ai( spawn_ai )
	unit:brain():set_active( true )
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
Stop leeching so hard on this forum and try contributing back.
If I understood Lua and scripting I would do it myself. I'll just wait for tomorrow for my friend to do it for me. I did ask that I wanted them to spawn in like any other special unit. I didn't say I wanted them to spawn whenever I killed a civilian. I can be rude to if you want.
Quote Originally Posted by sandman332 View Post
If I understood Lua and scripting I would do it myself. I'll just wait for tomorrow for my friend to do it for me. I did ask that I wanted them to spawn in like any other special unit. I didn't say I wanted them to spawn whenever I killed a civilian. I can be rude to if you want.
The fuck? Appreciate what people give you.
Quote Originally Posted by Kruxifix1 View Post
The fuck? Appreciate what people give you.
I am not going to appreciate anything that he gives me if he has to be rude in the first place.
Quote Originally Posted by sandman332 View Post
I am not going to appreciate anything that he gives me if he has to be rude in the first place.
I'm only rude to people who do nothing but request more and more stuff.

Yes, But I just want the super jump code buy itself, I don't want to be able to carry quicker and move quicker, I just want super jump by itself if that is possible.
Just wanted to ask a question. Is there any way to get the code for converting all enemies including specials to work even if your not hosting? Probaly won't work, but I just wanted to know for...
I also REALLY want to know this. Because right now, using super jump online does not look the best lol. So I will agree with you, Would it be possible to convert snipers without using super-jump?
Ok, I was unable to get the first code to work. I still CAN'T convert snipers or any other enemies from far away. I don't want to have to use super jump to convert these guys, can you tell me the...
Well I was unable to get either of these to work :/ Looks like I am going to have to use super jump to convert snipers for now :/
Is there possibly any way of getting the code to convert shields,snipers,bulldozers,tazers, and any other enemy to work if you are NOT hosting? Let me know! Thanks.
Would you or someone be able to make a code so we can dominate and convert enemies (especially snipers) from far away distance? Because right now I have to use super jump to convert a sniper....
Are you using a code to do it? Because I can only convert if I am infront of the enemy. I would really like to know.
I have a request: Could you make it so that the increased interact distance script can be toggled on and off? Don't know if it can but that would be great!
Thanks.
Thanks A lot! This worked! Also, is there anyway of getting the script to convert special enemies and regular enemies to work if you are not hosting? Or does that not work? Thanks again!
I have a request: Could the creator of this thread or someone modify the script that makes instant intimidations and can convert special enemies to be a toggle script? Because I still want to be...
Hey, can you make it so that the bulldozers are replaced with cloakers? I know someone that made it so that all enemies were cloakers. Sure there Ai is not the best, but it would make a good troll...
Its ALL you do.
Quote Originally Posted by dougbenham View Post
I'm only rude to people who do nothing but request more and more stuff.














Its ALL you do.
Yea, so what? I request things.
Quote Originally Posted by sandman332 View Post
Yea, so what? I request things.
Your unwillingness to learn how to do things on your own makes me not want to help you.
Quote Originally Posted by sandman332 View Post
I'll just wait for tomorrow for my friend to do it for me.
Why did you even ask here in the first place then? Just ask your friend for all your future requests.
[QUOTE=dougbenham;8838359]Your unwillingness to learn how to do things on your own makes me not want to help you.

I tried learning earlier. Not everyone can be a modding/hacking genius like you.
Ok, I want to apologize. I found a video on youtube about learning Lua. So far I am kinda understanding it. Sorry for lashing out and I will try not to request things so often.
Posts 1–15 of 26 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Talk with us