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
Scripts
Two "?" about scripting.
Two "?" about scripting.
8 replies
1

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
objectkill hook.
object
objectkill
objecttype1
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 12:39:15 pm
objectkill hooked function is for.
1

Offline