Jump to content

NoobzorTM

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by NoobzorTM

  1. Hello, I'm new to scripting and I've been trying to find a way to make spells have item requirements in order to be cast. For example, here I'm trying to make it so you can only cast Muffle if you have a Void Salt in your inventory. For this, I've based my script on the Transmute Ore spell (if you have iron ore in your inventory, it will do stuff. if you don't, it will do nothing). This is the transmute ore script taken from vanilla. In xEdit, Ore02 and Ore01 are linked to the FormIDs for iron and silver ore. Now look at my script: It's incredibly similar and also simpler than the transmute ore script. Pretty much all I've done is remove unwanted lines. The script is supposed to check whether I have enough spellReagent (linked to the FormID for Void Salts in the creation kit, the same way transmute ore does it for the iron ore), and if I do, then it casts realSpell (set to Muffle). Here's a screenshot of the magic effect in xEdit, in which my script is called: https://i.imgur.com/3dYsLss.png The issue is, that for some reason, no matter how many Void Salts I have in my inventory, the script never goes inside of the "IF" section, it always goes into the "ELSE", and I have no idea why it does that. If someone is able to figure out where my mistake is, I would love if you could let me know! Thanks!
×
×
  • Create New...