Jump to content

Script Assistance


Warrdean

Recommended Posts

I've only just figured out a slight understanding of scripting and TEScs but it still confuses me. How would I set this up to only unequip if i equip a weapon, and equip when have no weapon (hand to hand)? I have found out what to take out so i can wield it with any armor, but i have no idea how to set it up to re-equip when im back to hand to hand.

 

 

ScriptName xdblSCRIPTClawBrawlerL

float menuTimer
float gameTimer

Begin OnEquip Player
set dblMonkGearEquipped to dblMonkGearEquipped + 1

if (Player.GetEquipped MQ15Bracers)
	Player.UnequipItem zdblClawBrawlerL
else
	If (dblClawsAllowed <= 0)
		If (Player.GetItemCount zdblHands == 0)
			Player.AddItem zdblHands, 1
		Endif
		Player.EquipItem zdblHands
		set dblClawsAllowed to dblClawsAllowed + 1
	endif
endif
End

Begin OnUnequip Player
set dblMonkGearEquipped to dblMonkGearEquipped - 1
End

; ==========

Begin GameMode
set gameTimer to gameTimer + GetSecondsPassed

If (gameTimer >= 0.2) && (Player.GetEquipped zdblClawBrawlerL)
	If (dblClawsAllowed <= 0)
		Player.UnequipItem zdblClawBrawlerL
	Endif
	If (Player.GetWeaponAnimType != 0)
		Message "Knuckles cannot be equipped while wielding a weapon."
		Player.UnequipItem zdblClawBrawlerL
	Endif
Endif

If (gameTimer >= 0.2)
	set gameTimer to 0
Endif
End

Begin MenuMode
set menuTimer to menuTimer + GetSecondsPassed

If (menuTimer >= 0.2) && (Player.GetEquipped zdblClawBrawlerL)
	If (dblClawsAllowed <= 0)
		Player.UnequipItem zdblClawBrawlerL
	Endif
	If (Player.GetWeaponAnimType != 0)
		Message "Knuckles cannot be equipped while wielding a weapon."
		Player.UnequipItem zdblClawBrawlerL
	Endif
Endif

If (menuTimer >= 0.2)
	set menuTimer to 0
Endif
End

Link to comment
Share on other sites

If (Player.GetEquipped zdblClawBrawlerL == 0) && (Player.GetWeaponAnimType == 0)
 Player.EquipItem zdblClawBrawlerL
EndIf

 

Adding that to the GameMode block should hopefully do what you want. However, the script implies that there is other gear in addition to this item which may or may not need to be handled as well. Also, since i don't know what zdblClawBrawlerL is, I'm not sure whether it changes the GetWeaponAnimType or not.

 

Mez

Link to comment
Share on other sites

Thank you, I'll have to see how that works out :) and zdblClawBrawlerL is just the name of the item, i figured it would have been easier to put the original in my question other than like "item name" or something else.

 

 

EDIT: Thank you again for your help, adding that worked :) you made me very happy :D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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