Jump to content

Clothes give strength


Yuusen

Recommended Posts

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

- 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

endif

end

Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...