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 replies![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](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.
edited 1×, last 02.09.21 02:39:15 pm
![cs2d lua hook](img/i_codehelp.png)
![](img/smiles/veryannoyed.gif)
![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)