puffdrag0n Posted December 9, 2014 Share Posted December 9, 2014 So this is my first post here, and I was hoping it didn't have to come to this. But I have been trying to get this script working for two days now and I'm getting really frustrated. I'm trying to build a script so that it will exchange items. No problem right? The problem is I can't get the item count working because I'm a nooblet. What exactly am I doing wrong with this script? I mean like, how do I get it to take all my bottles instead of just one? scn SassRefillSCRIPTbegin onActivate playerif player.getItemCount SSBottleEmpty <= 1player.removeItem SSBottleEmpty 1player.addItem SSBottleFull 1endifend I'm sorry if I seem retarded, I have never coded before and this is my first time modding using geck. If you could help me I'd be extremely grateful and I'll promise to never ask stupid questions again. Link to comment Share on other sites More sharing options...
Ladez Posted December 9, 2014 Share Posted December 9, 2014 You need to save the item count to a variable and then pass that variable as a paremeter to the RemoveItem function. Like this: scn SassRefillSCRIPT int iCount begin onActivate player Set iCount to player.getItemCount SSBottleEmpty if iCount <= 1 player.removeItem SSBottleEmpty iCount player.addItem SSBottleFull iCount endif end If you post code in the future, use code tags around your script and use some indentation like I did to improve readability. :) Link to comment Share on other sites More sharing options...
puffdrag0n Posted December 9, 2014 Author Share Posted December 9, 2014 God damn, thank you so much I tried all sorts of things and nothing seemed to work. Sorry for the silly question and post, I will use the code tags in the future and try not to bother you guys. Link to comment Share on other sites More sharing options...
Ladez Posted December 9, 2014 Share Posted December 9, 2014 No bother, it's good to see someone new getting into modding. Keep the questions coming. That said, this was a bit basic. I recommend a tutorial like this to get you started on the basics of scripting. ;) Link to comment Share on other sites More sharing options...
Recommended Posts