I'm new to Lua but have spent some time going through the various tutorials, adding units etc and am now looking for a way in Lua to change an existing units side (and preferably loadout!).
Example of what I'm trying to achieve:
Side Red has an offshore unarmed oil platform (DBID 484) with a name of Red Rig. Side Blue sends a helo with troops to the platform capturing it.
When Blue helo enters a defined area I want to change it from Red control to Blue.
I can get my Event to fire and change the name to Blue Rig, but can't change the side.
Ideally I'd like to change the rig's load out when the side changes (to simulate the presence of troops on the rig).
So far I've been trying ScenEdit_SetUnit but other than the name change I can't get it to swap sides.
Wasn't sure if it would just be easier to delete Red Rig (DBID 484) and add Blue Rig (DBID 377 - armed version of the same rig).
Sorry if I've missed something obvious .... still new to Lua!

Thanks