Jump to content

Need help with finding redundant lines in script


BerzerkerKidd

Recommended Posts

I'm making a mod where when equipping a belt, it teleports you to an area with a bunch of trainers. To do this I just copied the script from the Daedric Sanctuary amulet, buuuuuut I found out that it nulls the script after you click yes once, I managed to get it to work multiple times, but I'm still very new to scripting, so I was hoping someone could point out any redundant lines in the script for me?

 

I want the message box to stay the same, asking yes or no before tping you to the cell, but everything else I need to remove

 

EDIT: If you could also tell me what to put in it so it can't be used in the Heart Chamber, that'd be swell and I'd be forever thankful to you ;u;

 

 

 

here's what I got:

Begin doveTrainingBeltScript

short button
short messageOn
short reset
short OnPcEquip

;if ( MenuMode == 1 )
;	Return
;endif


if ( OnPCEquip == 0 )
	set reset to 0
endif

if ( reset == 1 )
	return
endif

if ( OnPCEquip == 1 )
	if ( reset == 0 )
		Set OnPCEquip to 0
		MessageBox "Would you like to travel to the Hall of Masters?" "Yes" "No"
		set messageOn to 1
	endif
endif

if ( messageOn == 1)

	set button to GetButtonPressed

	if ( button >= 0 )
		set messageOn to 0
	endif

	if ( button == 0 )
		Player->PositionCell, 0, 0, 14000, 0, "Hall of Masters"
		set reset to 1		

	elseif ( button == 1 )
		set reset to 1
		return
	endif
endif



End

Thanks in advance for the help! c:

Edited by BerzerkerKidd
Link to comment
Share on other sites

Try this. Been a while since if coded Morrowind script.

Begin doveTrainingBeltScript

short button
short messageOn
short reset
short OnPcEquip

;if ( MenuMode == 1 )
;	Return
;endif


if ( OnPCEquip == 0 )
	set reset to 1
endif

if ( reset == 0 )
	return
endif

if ( OnPCEquip == 1 )
	if ( reset == 1 )
		Set OnPCEquip to 0
		MessageBox, "Would you like to travel to the Hall of Masters?", "Yes", "No"
                set reset to 0
		set messageOn to 1
	endif
endif

if ( messageOn == 1)

	set button to GetButtonPressed

	if ( button < 0 )
		return
	endif

	if ( button == 0 )
                if ( GetPCCell, "Heart Chamber" == 1 )
                       messageBox "Cannot be used here."
                       set reset to 0
                       return
                endIf
		Player->PositionCell, 0, 0, 14000, 0, "Hall of Masters"
		set reset to 0		

	else
                set messageOn to 0
		set reset to 0
	endif
endif

End

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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