So you want to make a gate for your base that you can open and close from inside, that is inaccessible from outside and that also looks realistic. What can do a better job than a good old Icarus bus from ArmA 2? Because the bus has user actions popping up only when you are on the right side of it, making left side the “out” side makes a lot of sense. Only if we could put some armour on the outside of the bus…
Looks like corrugated fence would do. It also moves with the bus and stays on even if the bus is destroyed. It won’t stop bullets though. Here is the link which explains attachTo and setVectorDirAndUp commands I used a bit more. Another thing that should be considered is what happens if someone rams into the bus. The bus of course would move just like in real life. So what one would do in this case? Perhaps place something to block bus from moving sideways, like a couple of flag poles?
The good thing about flag poles is that they would make sense being on the entrance to the base and you can even set own texture for the flag if you wish. On the picture above I used Bohemia flag. If you pass blank texture, you get bare flag poles. Anyway, here is the script I wrote that would attach fences to the bus and place 2 flag poles behind the bus:
And this is how you call the function:
Of course this is just a prototype. If you wish to make this persistent you need to consider few more angles. Have fun figuring those out .