Mandalore_The_Great Posted November 27, 2008 Share Posted November 27, 2008 How do I give two or more items to myself in a script? This is a sample script I made up void main() { object oItem=CreateItemOnObject( "g_a_class4002", GetFirstPC()); } Putting it twice doesn't work. Ideas? Link to comment Share on other sites More sharing options...
zbyl2 Posted November 27, 2008 Share Posted November 27, 2008 Use CreateItemOnObject() function more times? void main() { object oItem=CreateItemOnObject("item", GetFirstPC()); object oItem1=CreateItemOnObject("item1", GetFirstPC()); object oItem2=CreateItemOnObject("item2", GetFirstPC()); } Link to comment Share on other sites More sharing options...
Mandalore_The_Great Posted November 27, 2008 Author Share Posted November 27, 2008 I meant two or more of the same item Link to comment Share on other sites More sharing options...
zbyl2 Posted November 27, 2008 Share Posted November 27, 2008 So put same tag few times... void main() { object oItem=CreateItemOnObject("g_a_class4002", GetFirstPC()); object oItem1=CreateItemOnObject("g_a_class4002", GetFirstPC()); object oItem2=CreateItemOnObject("g_a_class4002", GetFirstPC()); } It will spawn three item with ResRef "g_a_class4002" in PC's inventory. Link to comment Share on other sites More sharing options...
Star Admiral Posted November 27, 2008 Share Posted November 27, 2008 Add an additional parameter with the number of items needed. void main() { object oItem = CreateItemOnObject( "g_a_class4002", GetFirstPC(), [i]nAmount[/i] ); } - Star Admiral Link to comment Share on other sites More sharing options...
Mandalore_The_Great Posted November 27, 2008 Author Share Posted November 27, 2008 where you put nAmount, do I put the N in front of it? or do I just put 2 there? Link to comment Share on other sites More sharing options...
Darth333 Posted November 27, 2008 Share Posted November 27, 2008 just replace nAmount by 2 (or any number of items you want to add) Link to comment Share on other sites More sharing options...
Mandalore_The_Great Posted November 27, 2008 Author Share Posted November 27, 2008 alright thanks one other thing: I'm trying to skin g_w_blstrrfl001 but when I try it in game it just flat out doesn't work. I made two new .uti files, mandalore_rifle and republic_rifle, and I named the file the same exact thing, and I can't get it to work. help? Edit: oh never mind. I was using a different tut than the one on this site. I'll follow that one thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.