Forum

> > CS2D > Scripts > Two "?" about scripting.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Two "?" about scripting.

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Two "?" about scripting.

Andrew12357
User Off Offline

Zitieren
How do I block projectiles when they hit a barricade, like EnderCrypt's script?

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!

alt Re: Two "?" about scripting.

Bowlinghead
User Off Offline

Zitieren
objectkill does not return anything. But the "objectid" or "id" parameter could be thing what you are looking for:
cs2d lua cmd object
cs2d lua hook objectkill
cs2d lua cmd objecttype
1
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht