Need lua script

Started by Alvio, July 10, 2019, 10:28:52 AM

Previous topic - Next topic
Hello.

There is a character and he should be (by quantity) one.
But if a player chooses this character, and the bot of the same character is already on the map, then there are already two characters on the map.

I used to have a script, but I lost it.
Write on the memory and documentation does not work, i'm missing something...

Can anyone help?

July 10, 2019, 11:55:25 AM #1 Last Edit: July 10, 2019, 11:57:03 AM by wsa30h
try writing just 0 for that character for example sniper   = { "rep_inf_ep2_sniper",5, 12}, to sniper   = { "rep_inf_ep2_sniper",0, 0}, it only effects bots. doesent work with the droideka
mods and maps in progress:<br />--Bf1 expanded edition 3.0 version
-- bf1 tcw battles
-- bf1 seasons mod season 1
-- bf2 expanded edition tbh

Thanks for the reply, but this is not what I need.
I will clarify ...

I put Kenobi as a normal unit.
   - if the player has not chosen him, then the bot will spawn,
   - if the player chooses it, but the bot (Kenobi) is already on the map and is still alive, then it turns out two Kenobi.
So, when a player (Kenobi) spawn, the bot (Kenobi) should disappear.

In my codes:
{"rep_hero_obiwan", 1, 1}

And also in map_name.lua:
In function ScriptPostLoad() should be something like this
OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then

KillObject("rep_hero_obiwan")

end
end
)


But it does not work, and still there are two Kenobi on the map (

oh ok sorry i dont think i can help with that  :confused:
mods and maps in progress:<br />--Bf1 expanded edition 3.0 version
-- bf1 tcw battles
-- bf1 seasons mod season 1
-- bf2 expanded edition tbh