#I'm creating a unit, but the inventar doesn't work for it and it automatically attacks
1 messages · Page 1 of 1 (latest)
- it's not your unit, perhaps your ally, try creating unit via lua methods such as
CreateUnitByName
it accepts an "owner" parameter, set it to your hero,
you can also change it bySetOwnerlater - most units have an "AcquisitionRange", which determines the radius they become aggressive when enemy approaches
declare anAttackAcquisitionRangein unit kv
also can be changed by lua later
ps. if you find that you cant control the unit you create, call SetControllableByPlayer
Okay, I'll try what you said, but I'll ask right away, where can I see examples?
what example? lua code?
Yes, the code in which all this could be implemented, or the project
nope, they are just pieces of code
or you can just search these method on github or moddota
https://moddota.com/api/#!/vscripts