Please help me fix my script

Post » Wed Aug 25, 2010 8:40 am

I'm new to scripting. I made this by looking at other scripts and the GECK wiki.

This is attached to an autodoc, a message pops up and this script is supposed to define what the options do when you click on them. The menu is there, but the buttons in the menu do nothing, and if i give button 0 a function, it's actions always runs when the message starts. (button 0 is now "Cancel").

edit: sorry, wrong thread description

scn JVaultAutodocScriptshort Buttonbegin OnActivate	if IsActionRef player				ShowMessage JVaultAutodocMsg			endifendbegin MenuMode 1001	if (Button == 1)		player.resethealth	endif		if (Button == 2)		player.RestoreAV RadiationRads 1000	endif	if (Button == 3)		RemoveSpell WithdrawalAlcohol		RemoveSpell WithdrawalBuffout		RemoveSpell WithdrawalHydra		RemoveSpell WithdrawalJet		RemoveSpell WithdrawalMentats		RemoveSpell WithdrawalMorphine		RemoveSpell WithdrawalPsycho		RemoveSpell WithdrawalQuantumNukacola		RemoveSpell WithdrawalRebound		RemoveSpell WithdrawalSteady		RemoveSpell WithdrawalTobacco		RemoveSpell WithdrawalTurbo	endif	if (Button == 4)		ShowPlasticSurgeonMenu	endifend

User avatar
RUby DIaz
 
Posts: 3383
Joined: Wed Nov 29, 2006 8:18 am

Post » Wed Aug 25, 2010 2:12 am

Try this...

scn JVaultAutodocScriptshort Buttonshort activebegin onactivate	if IsActionRef player				ShowMessage JVaultAutodocMsg                set active to 1			endifendbegin GameMode if active == 1   set button to getbuttonpressed if button == 0    set active to 0 elseif (Button == 1)   player.resethealth elseif (Button == 2)   player.RestoreAV RadiationRads 1000 elseif (Button == 3)   RemoveSpell WithdrawalAlcohol   RemoveSpell WithdrawalBuffout   RemoveSpell WithdrawalHydra   RemoveSpell WithdrawalJet   RemoveSpell WithdrawalMentats   RemoveSpell WithdrawalMorphine   RemoveSpell WithdrawalPsycho   RemoveSpell WithdrawalQuantumNukacola   RemoveSpell WithdrawalRebound   RemoveSpell WithdrawalSteady   RemoveSpell WithdrawalTobacco   RemoveSpell WithdrawalTurbo elseif (Button == 4)   ShowPlasticSurgeonMenuendif endifend

User avatar
Epul Kedah
 
Posts: 3545
Joined: Tue Oct 09, 2007 3:35 am

Post » Wed Aug 25, 2010 12:38 pm

Thanks a lot. It works. I'll give you credit in the readme.
User avatar
Rachel Briere
 
Posts: 3438
Joined: Thu Dec 28, 2006 9:09 am

Post » Wed Aug 25, 2010 1:56 am

No need to credit for the help. Good luck with the mod.
User avatar
Penny Courture
 
Posts: 3438
Joined: Sat Dec 23, 2006 11:59 pm


Return to Fallout: New Vegas