Hi,
is it possible to exchange a weapon via lua script?? Let's say there is a unit with airstrike and it's stupid to have it on TantiveIV. So now i can make two different units with different weapons, but it doesn't seams to be a good solution. So i thought i can exchange the weapon via lua in the tantiveIV script. Is that possible? and how would i do that??
Change weapon via Lua
Moderator: Moderators
- Anakin
- Master of the Force

- Posts: 4817
- Joined: Sat Sep 19, 2009 11:37 am
- Projects :: RC Side Mod - Remastered - SWBF3 Legacy
- Location: Mos Espa (germany)
-
thelegend
- Sith

- Posts: 1433
- Joined: Thu Jan 23, 2014 6:01 am
- Projects :: Star Wars - Battlefront III Legacy
- xbox live or psn: El_Fabricio#
- Location: Right behind you :)
Re: [LUA]change weapon
You can change a unit's weaponary through SetClassProperty in your .lua (below ScriptPostLoad):
But make sure your replacement weapon is loaded by an unit anywhere else (In ReadDataFile), or the game won't know where to find the new weapon.
Code: Select all
SetClassProperty("Your_Unit_Name", "WeaponName1", "Name_of_the_odf_weapon")