Yuusen Posted August 1, 2010 Share Posted August 1, 2010 Hi! I can't seem to figure out why this code doesn't work. I hope you can help me. Basically what this code was supposed to do was, as soon as the player puts on upper body clothing, he gets 10 points in strength. If he puts on upper body armor, he loses -10 points in strength. I want to do this with all other body parts, but for now it doesn't even seem to work for this one alone! ScriptName NoArmorB begin MenuMode 1 ref UpperBody set UpperBody to player.GetEquippedObject 2 end begin OnEquip if (UpperBody.IsClothing) ModActorValue Strength 10 else if (UpperBody.IsArmor) ModActorValue Strength -10 else endif end I know it's not going to work as it is supposed to like this, but nothing even works in game. At least he should do one of them, add or subtract strength, but he does neither. Do I maybe have to run this as a magic effect? Sorry, this is my first time ever I'm actually trying to script something. Link to comment Share on other sites More sharing options...
forli Posted August 1, 2010 Share Posted August 1, 2010 - Move "Player.GetEquippedObject 2" to OnEquip, before the condition - Move "ref Upperbody" outside MenuMode, just after "ScriptName NoArmorB" - Delete: Begin MenuMode --- End (Now it should be empty). - Delete "Else" at the end of the condition So now it is: ScriptName NoArmorB ref UpperBody begin OnEquip set Upperbody to Player.GetEquippedObject 2 if (UpperBody.IsClothing) ModActorValue Strength 10 else if (UpperBody.IsArmor) ModActorValue Strength -10 endifend Link to comment Share on other sites More sharing options...
Yuusen Posted August 1, 2010 Author Share Posted August 1, 2010 Thank you for the quick answer. Unfortunately it still doesn't work. :ermm:Does it work for you? Link to comment Share on other sites More sharing options...
GODSBANE123456 Posted August 1, 2010 Share Posted August 1, 2010 why can you not just make it so that it is an enchanted item, that way would be easier, except that you lose the ability to enchant the item later while in-game Link to comment Share on other sites More sharing options...
Yuusen Posted August 2, 2010 Author Share Posted August 2, 2010 So now, I changed the script a bit. I just need to have the scripted ring in my inventory. Don't even need to equip it. Whenever I equip armor or clothing, it should change the value. ScriptName NoArmorB ref UpperBody short UpperBodyArmor short Trigger begin MenuMode 1 set UpperBody to player.GetEquippedObject 2 if ( Upperbody.IsClothing ) ModActorValue Strength 10 set UpperBodyArmor to 1 set Trigger to 1 elseif ( Upperbody.isArmor ) ModActorValue Strength -10 set UpperBodyArmor to 2 set Trigger to 1 endif end begin MenuMode 1 if ( Trigger == 1) if ( UpperBodyArmor == 1 ) ModActorValue Strength -10 set Trigger to 0 elseif ( UpperBodyArmor == 2 ) ModActorValue Strength 10 set Trigger to 0 endif endif end It doesn't work. Seriously? :pinch: @GODSBANE123456: Thanks for the warning, almost clicked on it. :happy: Link to comment Share on other sites More sharing options...
Recommended Posts