Guest KillMeTwice Posted December 22, 2008 Share Posted December 22, 2008 I just need a script to remove item from player inventory and adding another when clicking an activator. Link to comment Share on other sites More sharing options...
LoginToDownload Posted December 22, 2008 Share Posted December 22, 2008 Sure thing. scn MySwapperScript ;scn stands for Scriptname. All scripts need to be named on their first line. Begin OnActivate ;All of a script's functions need to take place in a Begin/End loop, that determines when they play. ;An OnActivate loop, as the name implies, runs when you activate something in the world. if (player.GetItemCount MyItem1 > 0) ;The contents of an If/Endif loop only run when their specified condition is true. ;In this case, the player has more than zero of MyItem1. player.RemoveItem MyItem1 1 player.AddItem MyItem2 1 endif end If you wanted it to do the swap when activating the object in your inventory, you'd have to use OnEquip instead of OnActivate. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.