Code: Select all
OnCharacterSpawn(function(character)
if GetCharacterTeam(character) == IMP and GetReinforcementCount(IMP) == 1 then
SelectCharacterClass(character,"imp_hero_darthvader")
end
end)
EDIT
I tried this code:
Code: Select all
vaderspawn = true
OnCharacterSpawn(function(character)
if GetCharacterTeam(character) == IMP and vaderspawn and GetReinforcementCount(IMP) == 1 then
local loc = GetEntityMatrix(GetCharacterUnit(character))
AddReinforcements(IMP, 1)
KillObject(GetCharacterUnit(character))
SelectCharacterTeam(character, IMP)
SelectCharacterClass(character,"imp_hero_darthvader")
SpawnCharacter(character, loc)
vaderspawn = false
end
end)
Double posting is against the RULES; please EDIT your post instead -Staff


