Adding auto turrets onto destroyable objects
Moderator: Moderators
-
- First Lance Corporal
- Posts: 120
- Joined: Wed Dec 11, 2019 3:52 pm
- Projects :: Trench War
- xbox live or psn: No gamertag set
Adding auto turrets onto destroyable objects
I added a destroyable frigate ship onto a ground map, and i put some auto turrets on it. Everything works fine, except when the frigate is destroyed, the auto turrets I put on it are still floating there. Does anyone know how to make it so that the auto turrets are destroyed when the frigate they're attached to is destroyed?
- AnthonyBF2
- Sith
- Posts: 1255
- Joined: Wed Aug 21, 2013 3:55 pm
- Projects :: PS2+PSP Overhaul
Re: Adding auto turrets onto destroyable objects
Code: Select all
OnObjectKillName(
function(object, killer)
KillObject("imptur1")
KillObject("imptur2")
KillObject("imptur3")
KillObject("imptur4")
end,
"impturretmain"
)
impturretmain = change to the name of your frigate object (instance name, not ODF name)
Add or remove more KillObject() lines to match the number of items you want to kill, with each line targeting another turret's instance name.
-
- First Lance Corporal
- Posts: 120
- Joined: Wed Dec 11, 2019 3:52 pm
- Projects :: Trench War
- xbox live or psn: No gamertag set
Re: Adding auto turrets onto destroyable objects
Works like a charm! Thank you very much!