DynasuarezWrecks Posted July 2, 2016 Share Posted July 2, 2016 I am working on a mod that provides a perk when an item is picked up, similar to the way the lucky 8 ball provided its luck boost in Fallout 3. I have managed to attach the perk to the item with a simple script like follows: Begin OnAdd Player.AddPerkEnd BeginOnDrop Player.RemovePerkEnd For the most part, it works fine, but I am hitting a snag. The lucky 8 ball was simple because there was only one instance of it. My mod involves some vanilla items that you can find multiple instances of, and if you are holding, say, two of the item and drop one, the perk is removed even though you are still holding one because the script only cares that the item has been dropped. My goal is to prevent the removal of the perk as long as you are holding at least one. I have looked at some other things within the GECK to try and find a solution, like the relationship between graves and shovels. I have tried using different scripts like the following: Begin OnAdd if Player.GetItemCount [item ID here] = 1 Player.AddPerk endifEnd Begin OnDrop if Player.GetItemCount [item ID here] = 0 Player.RemovePerk endifEnd I have tried a couple of different conditions and syntaxes, but nothing I do is working. The GECK won't even let me close the script box because the script is erroneous somehow. Is it a syntax error? Is it even possible to begin with? Helpful suggestions are appreciated. Link to comment Share on other sites More sharing options...
Ladez Posted July 2, 2016 Share Posted July 2, 2016 You need two equals signs for comparison, like so: if Player.GetItemCount [item ID here] == 0 Link to comment Share on other sites More sharing options...
DynasuarezWrecks Posted July 2, 2016 Author Share Posted July 2, 2016 sonofabitch. That worked. I'm basically a dumbass, I guess. Thanks. Link to comment Share on other sites More sharing options...
uhmattbravo Posted July 2, 2016 Share Posted July 2, 2016 It's an easy mistake to make. I looked over it earlier and didn't catch it. Link to comment Share on other sites More sharing options...
Recommended Posts