CGT-Source icon indicating copy to clipboard operation
CGT-Source copied to clipboard

Do you know how to change the outpost initial team?

Open Macaco227 opened this issue 4 years ago • 1 comments

Do you know how to change the outpost initial team?

Iv been scripting for months and I can't figure it out please help. this is my failed attempt at an initial team changing code please help:

function CAddonTemplateGameMode:Outpostint()

local outpostEntities = Entities:FindAllByClassname( "npc_dota_watch_tower")

for _,outpostEnt in pairs( outpostEntities ) do print(tostring(outpostEnt)) outpostEnt:SetTeam(4) end end

Macaco227 avatar May 11 '20 16:05 Macaco227

Im not so sure with this. You might need to wait for the player to spawn before calling this code. If you crete a listener function for "npc_spawned" and then call your code i.e. FindAllByClassname....

pohka avatar May 29 '20 16:05 pohka