DasdaBP Posted December 20, 2022 Share Posted December 20, 2022 Hey! I'm new to modding and I'm trying to figure out how to make a script so a weapon drains magicka while the player has it drawn. For that, I devised two scripts. One script for a magic effect that drains the player's magicka over time when they have a weapon drawn. The effect is registered to listen for the ACTOR_ACTION_DRAW_START and ACTOR_ACTION_SHEATH_END actor actions, which correspond to when the player begins or ends drawing their weapon. When the player begins drawing their weapon, the script stores the player's base magicka value and registers for updates every 2 seconds. The script then drains a percentage of the player's magicka every update until either the player's magicka reaches 0 or 30 updates have occurred. If the player sheaths their weapon, the script unregisters for updates and stops draining magicka. And also a script for adding the mentioned magic effect once the player equips the weapon (and a little bit more). Script for the magic effect: https://pastebin.com/9GiB2W11 Script for the weapon: https://pastebin.com/se3V55pB I have done the whole "attach the magic effec to a spell, attach the spell to the weapon via a script" thing but it just doesnt work . The message that the Drain Magicka Effect was added does show up, but it never gets added. It doesnt show up in the active effects page nor does any actual effect on the player's magicka happen. I really dont know what to do about this. Link to comment Share on other sites More sharing options...
Altbert Posted December 21, 2022 Share Posted December 21, 2022 Attach the magic effect to an ENCHANTMENT, and the enchantment to the weapon. Link to comment Share on other sites More sharing options...
Gokual Posted December 23, 2022 Share Posted December 23, 2022 Thanks it work ! Link to comment Share on other sites More sharing options...
Altbert Posted December 23, 2022 Share Posted December 23, 2022 You're welcome. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now