Equip Change

*Part of the free script pack that Taz released.*

```
Using "RC_Core.rcm"
; Default equipped items change script for player characters
; You may alter this script however you like, but DO NOT RENAME OR DELETE IT

; The entry function for this script is always "Main"
; The context actor for the script is null
;Basic Equip change strength only
; you will need to add a check so that attribute given in level up will be regiven here.
Function Main()

     Player = Actor()
	Playerlvl% = ActorLevel(Player)
	Playerstr% = Attribute(Player, "Strength")
	Playerstatstr% = 0

    PName$ = Name(Player)
    PHuman% = ActorIsHuman(Player)

 ;-------------------------------------------------------------------------------------------------------
; ITEM STRENGTH CHECK
;-------------------------------------------------------------------------------------------------------
	Feetstr% = ItemAttribute(ActorFeet(Player), "Strength")
	Handsstr% = ItemAttribute(ActorHands(Player), "Strength")
	Legsstr% = ItemAttribute(ActorLegs(Player), "Strength")
	Cheststr% = ItemAttribute(ActorChest(Player), "Strength")
	Shieldstr% = ItemAttribute(ActorShield(Player), "Strength")
	Hatstr% = ItemAttribute(ActorHat(Player), "Strength")
	Weaponstr% = ItemAttribute(ActorWeapon(Player), "Strength")

ResultCheststr% = ActorChest(Player)
ResultHatstr% = ActorHands(Player)
ResultWeaponstr% = ActorWeapon(Player)
ResultFeetstr% = ActorFeet(Player)
ResultHandsstr% = ActorHands(Player)
ResultLegsstr% = ActorLegs(Player)
ResultShieldstr% = ActorShield(Player)

        If (Playerstatstr >= 0)
            playercurentstatstr = Playerstatstr
        Endif

         playertotalstr% = playercurentstatstr + 1
        Playerlvlstr% = Feetstr + Handsstr + Legsstr + Cheststr + Shieldstr + Hatstr + Weaponstr + playertotalstr  ;   Player health @ x lvl with gear on

 If (ResultCheststr = 1)
 	newPlayerstr% = Attribute(Player, "Strength")
 	SetMaxAttribute(Player, "Strength", newPlayerstr)
 	SetAttribute(Player, "Strength", newPlayerstr)
 Else
 	SetMaxAttribute(Player, "Strength", + Playerlvlstr)
 	SetAttribute(Player, "Strength", + Playerlvlstr)
 EndIf

 If (ResultHatstr = 1)
 	newPlayerstr% = Attribute(Player, "Strength")
 	SetMaxAttribute(Player, "Strength", newPlayerstr)
 	SetAttribute(Player, "Strength", newPlayerstr)
 Else
 	SetMaxAttribute(Player, "Strength", + Playerlvlstr)
 	SetAttribute(Player, "Strength", + Playerlvlstr)
 EndIf

 If (ResultWeaponstr = 1)
 	newPlayerstr% = Attribute(Player, "Strength")
 	SetMaxAttribute(Player, "Strength", newPlayerstr)
 	SetAttribute(Player, "Strength", newPlayerstr)
 Else
 	SetMaxAttribute(Player, "Strength", + Playerlvlstr)
 	SetAttribute(Player, "Strength", + Playerlvlstr)
 EndIf

 If (ResultFeetstr = 1)
 	NewPlayerstr% = Attribute(Player, "Strength")
 	SetMaxAttribute(Player, "Strength", newPlayerstr)
 	SetAttribute(Player, "Strength", NewPlayerstr)
 Else
 	SetMaxAttribute(Player, "Strength", + Playerlvlstr)
 	SetAttribute(Player, "Strength", + Playerlvlstr)
 Endif

 If (ResultHandsstr = 1)
 	NewPlayerstr% = Attribute(Player, "Strength")
 	SetMaxAttribute(Player, "Strength", newPlayerstr)
 	SetAttribute(Player, "Strength", NewPlayerstr)
 Else
 	SetMaxAttribute(Player, "Strength", + Playerlvlstr)
 	SetAttribute(Player, "Strength", + Playerlvlstr)
 Endif

 If (ResultLegsstr = 1)
 	NewPlayerstr% = Attribute(Player, "Strength")
 	SetMaxAttribute(Player, "Strength", newPlayerstr)
 	SetAttribute(Player, "Strength", NewPlayerstr)
 Else
 	SetMaxAttribute(Player, "Strength", + Playerlvlstr)
 	SetAttribute(Player, "Strength", + Playerlvlstr)
 Endif

 If (ResultShieldstr = 1)
 	NewPlayerstr% = Attribute(Player, "Strength")
 	SetMaxAttribute(Player, "Strength", newPlayerstr)
 	SetAttribute(Player, "Strength", NewPlayerstr)
 Else
 	SetMaxAttribute(Player, "Strength", + Playerlvlstr)
 	SetAttribute(Player, "Strength", + Playerlvlstr)
 Endif

 End Function

```