Also, whenever a building is destroyed (made by players), it does not trigger the "break" hook, why? If there is a hook for this, please tell me!
Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
Two "?" about scripting.
8 Antworten![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)
Also, whenever a building is destroyed (made by players), it does not trigger the "break" hook, why? If there is a hook for this, please tell me!
2. Use the
![cs2d lua hook](img/i_codehelp.png)
![cs2d lua cmd](img/i_codehelp.png)
![cs2d lua hook](img/i_codehelp.png)
![cs2d lua cmd](img/i_codehelp.png)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
--untested addhook("objectkill","OG") function OG(oid, pid) 	msg("Type: "..objecttype(object(oid,"type"), "name")) 	msg("Owner: "..object(oid,"player")) 	msg("X: "..object(oid,"x")) 	msg("Y: "..object(oid,"y")) end
Edit:
Note that the objecttype describes what it is like turret, etc.
What you get here instead, is a dynamic object id. Those exist for each turret, barricade, etc.
1× editiert, zuletzt 02.09.21 14:39:15
![cs2d lua hook](img/i_codehelp.png)
![](img/smiles/veryannoyed.gif)
![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)