DJhobo Posted November 8, 2013 Share Posted November 8, 2013 I decided that this was mod talk but I am new so please correct me if I am wrong. Hi there, so I decided to make a new mod to teach myself scripting. The mod basically adds a suitcase that is carried around As equipment and when equipped it will be removed then add and equip a special 9mm pistol. When the 9mm is unequipped it is removed and the suitcase is re-added.I have Done all the scripts and got it to work, but after the first time the gun is removed again and you get the suit case, equipping the suitcase causes the game to crashThe scripts on the items are as follows: Suitcase: scn SuitcaseScript begin onEquip if player.GetEquipped 01000ae7 ;01000ae7 is the caseplayer.additem 01000AE0 1 1 ;01000AE0 is the pistolplayer.equipitem 01000AE0 0 1 player.removeitem 01000ae7 1endif END Pistol: scn Gunscript Begin OnUnEquip if player.GetEquipped 01000AE0 ==0player.removeitem 01000AE0 1player.additem 01000ae7 1 endifEND Please give me a hand :confused: Link to comment Share on other sites More sharing options...
jazzisparis Posted November 8, 2013 Share Posted November 8, 2013 You're not supposed to, and it's a bad idea to use Form IDs in scripts. Use the items' Editor IDs, instead. Moreover, the GetEquipped condition is redundant (in both scripts). Link to comment Share on other sites More sharing options...
bjornl Posted November 8, 2013 Share Posted November 8, 2013 First (and most important) JIP is (as is normally the case) correct. It is because she is an android, don't be fooled by the smoke like Det. Deckard. Just wanted to add I thought your idea was both amusing and clever. Link to comment Share on other sites More sharing options...
DJhobo Posted November 9, 2013 Author Share Posted November 9, 2013 I cleaned the script up using the tips but sadly it still crashes, i am assuming its the script getting confused after obtaining the new case. Link to comment Share on other sites More sharing options...
blove Posted November 9, 2013 Share Posted November 9, 2013 Looks like you are destroying the item that carries the instance of the script. Link to comment Share on other sites More sharing options...
DJhobo Posted November 9, 2013 Author Share Posted November 9, 2013 Thats what baffles me, as i re add the item using the base ref, shouldn't the script be attached? Link to comment Share on other sites More sharing options...
Recommended Posts