Script problem

Post » Sun Aug 09, 2009 8:22 pm

Begin Shardsplitter
short OnPCEquip
if ( OnPCEquip == 1 )
player->additem "shard-arrow" 500
endif
if ( GetItemCount "shard-arrow" =< 5 )
player->additem "shard-arrow" 100
MessageBox, "Shardsplitter senses your need for arrows and has granted you an additional 100 Shard Arrows"
endif
end Shardsplitter


thats my limitless arrow script and i mean it litarly
i equip the bow it gives me my inital 500 arrows and keeps adding 100 +100 over and over cant equip because its busy playing rabbit and multiplying
help would truly be appriciated
User avatar
Peetay
 
Posts: 3303
Joined: Sun Jul 22, 2007 10:33 am

Post » Sun Aug 09, 2009 1:40 pm

Begin Shardsplittershort OnPCEquipshort doneThisif ( OnPCEquip == 1 )   If ( doneThis == 0 )      player->additem "shard-arrow" 500      set doneThis to 1   endIfendifif ( GetItemCount "shard-arrow" <= 5 )   player->additem "shard-arrow" 100   MessageBox, "Shardsplitter senses your need for arrows and has granted you an additional 100 Shard Arrows"endifend Shardsplitter


first thing to remember with Morrowind scripting is that it does not stop at the end; it starts over at the end. Also "=<" should be "<=". By using the code tag (not codebox because that has annoying scoll bars) you can keep your tabs when you copy and paste.
User avatar
Alexandra walker
 
Posts: 3441
Joined: Wed Sep 13, 2006 2:50 am

Post » Sun Aug 09, 2009 12:56 pm

Begin Shardsplittershort OnPCEquipshort doneThisif ( OnPCEquip == 1 )   If ( doneThis == 0 )      player->additem "shard-arrow" 500      set doneThis to 1   endIfendifif ( GetItemCount "shard-arrow" <= 5 )   player->additem "shard-arrow" 100   MessageBox, "Shardsplitter senses your need for arrows and has granted you an additional 100 Shard Arrows"endifend Shardsplitter


first thing to remember with Morrowind scripting is that it does not stop at the end; it starts over at the end. Also "=<" should be "<=". By using the code tag (not codebox because that has annoying scoll bars) you can keep your tabs when you copy and paste.

thank you sooo much i was wondering why i was getting that unknown operator
User avatar
Andy durkan
 
Posts: 3459
Joined: Fri Aug 03, 2007 3:05 pm

Post » Sun Aug 09, 2009 9:48 pm

Begin Shardsplittershort OnPCEquipshort doneThisif ( OnPCEquip == 1 )   If ( doneThis == 0 )      player->additem "shard-arrow" 500      set doneThis to 1   endIfendifif ( GetItemCount "shard-arrow" <= 5 )   player->additem "shard-arrow" 100   MessageBox, "Shardsplitter senses your need for arrows and has granted you an additional 100 Shard Arrows"endifend Shardsplitter


first thing to remember with Morrowind scripting is that it does not stop at the end; it starts over at the end. Also "=<" should be "<=". By using the code tag (not codebox because that has annoying scoll bars) you can keep your tabs when you copy and paste.

thnx for the help but im still having the multiply problem i go into inventory and it keeps adding 100 arrows
User avatar
Pete Schmitzer
 
Posts: 3387
Joined: Fri Sep 14, 2007 8:20 am

Post » Sun Aug 09, 2009 6:55 pm

you need the player-> prefix on getitemcount. Otherwise it is testing the getitemcount of the item it is on, and the bow itself doesn't own any arrows. :)
User avatar
Alba Casas
 
Posts: 3478
Joined: Tue Dec 12, 2006 2:31 pm

Post » Sun Aug 09, 2009 7:56 am

you need the player-> prefix on getitemcount. Otherwise it is testing the getitemcount of the item it is on, and the bow itself doesn't own any arrows. :)

ill try it thnx
User avatar
Cody Banks
 
Posts: 3393
Joined: Thu Nov 22, 2007 9:30 am


Return to III - Morrowind