Page 1 of 1

Turret team changer weapon

Posted: Tue Jan 03, 2012 4:54 pm
by Dakota
ok i want to make a weapon that changes the team of turrets only.

example: some enemy places an auto turret and then you walk up to it and use the weapon and it makes the turret go to your team.

it would also work on turrets around the map that are on no one's team but i will set them up in the lua to vehicleself. this could also work on turrets that are dispensed that are vehicleself that turn to team 0 when you get out.

i need to know what i would have to do to set up a weapon like this. i also need to know what i would do if it was an era mod, would i be able to do it still and would i just type in into each LUA?

Re: turret team changer weapon

Posted: Tue Jan 03, 2012 5:31 pm
by DarthD.U.C.K.
i think you should use onobjectdamage, then check if the object is a turret, then check the weapon with getlasthitweaponclass and finally look on which team it is and on which team the damager is. if everything fits, change the object team.
and yes, you have to put this in ever lua in order to make it work in that mission