CGT-Source
CGT-Source copied to clipboard
Do you know how to change the outpost initial team?
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
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....