Two "?" about scripting.
8 replies



01.09.21 02:47:30 pm
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!
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!
Ask himself. He will surely be more than happy to answer that.
Shit your pants:
Outlast II Mod (29) | Create your UI faster: CS2D UI Framework


"objectkill" Does not return x and y pos, or the player ID that built the object, so I do not know who's supply is that.
objectkill does not return anything. But the "objectid" or "id" parameter could be thing what you are looking for:
object
objectkill
objecttype
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.



Code:
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
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
Share time limited free games here

Alright then now I understand why I can upgrade barricades without having "upgraded barricades" researched.




