you are setting gunobj after using the variable. that's a start.
Quote: "
Setup gun for player
lock object on GunObj // gunobj = 0 or random data
scale object GunObj,2,2,4 // gunobj = 0 or random data
rotate object GunObj,270,0,0 // gunobj = 0 or random data
position object GunObj,0.5,-1,2 // gunobj = 0 or random data
disable object zdepth GunObj // gunobj = 0 or random data
`This loads the weapon model
GunObj=2 : load object "mediamodelsweaponsm1_carbine.3ds",GunObj // now it = 2
"
ALWAYS declare a value that is not going to change as a CONSTANT... it will not affect the size or speed of your application, but make it a whole lot easier when it comes to changing a value like the gunobj's id.... when you have 10k plus lines of code. It will also prevent you from erroniously changing a value like that.
EDIT:: also, make sure you are on the latest version of DBP including the Editor.... 3ds support was yanked out and put back in a few versions ago.
http://ausukusa.breakset.com