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
But it does not work, and still there are two Kenobi on the map (
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
Code Select
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 (