Jump to content

Keybind issue


Razgreeze

Recommended Posts

I'm trying to make a small mod that allows me to go invisible when I press 'C' as long as I have a certain item. So far I believe that it is a key binding issue but I'm not certain.

 

Below is my code.

 

SCN InvisibilityScript

 

short sKeyPressed == 46

short sActive == 0

Begin onAdd player

 

 

if (sKeyPressed)

if (sActive == 0)

player.addspell testinvis

ShowMessage InvisMSG

else

player.removespell testinvis

ShowMessage InvisoffMSG

endif

endif

 

 

End

 

If anyone has any suggestions how I could resolve this problem or something else I may interrupt the stealth, I'd be glad to hear it.

 

Other Info: InvisMSG/InvisoffMSG just say that it has been activated or deactivated.

testinvis has a duration of 15 seconds and a magnitude of 10%.

46 is what I believe is the # for C, please correct me if I am wrong.

Link to comment
Share on other sites

Here's my reply from your thread on the official GECK forum:

You want to use IsKeyPressed:
ScriptName InvisibilityScript

int bIsCPressed

Begin GameMode

if bIsCPressed != IsKeyPressed 46;C
	set bIsCPressed to bIsCPressed == 0
	if bIsCPressed
		if player.IsSpellTarget TestInvis
			player.AddSpell TestInvis
			ShowMessage InvisMSG
		else
			player.RemoveSpell TestInvis
			ShowMessage InvisOffMSG
		endif
	endif
endif

End

Cipscis

Link to comment
Share on other sites

  • Recently Browsing   0 members

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