Here is the script, error is after Messagebox "TEST 1" line.
- Code: Select all
Begin HV_RMMT_MakeTarget2
long MyRef
short state
short rand
short ChooseTarget
long MyString
short DoOnce
long IsValid
float Myx
float Myy
float Myz
long MyCell
;No dunmers in this cell so we are going to make our own.
ifx ( DoOnce )
else
set rand to random, 36
xFileRewind "MT_TargetCell"
setx MyCell to xFileReadString "MT_TargetCell"
Messagebox "TEST 1"
xFileRewind "MCADunmerlist.RMMT"
set Myx to HV_RMMT_Myx
set Myy to HV_RMMT_Myy
set Myz to HV_RMMT_Myz
set DoOnce to 1
endif
ifx ( rand )
setx MyString to xFileReadString "MCADunmerlist.RMMT"
set rand to ( rand - 1 )
else
Messagebox "Target Placed"
setx Myref to xPlace MyString
xsetRef Myref
Startscript "HV_RM_MT_Targetscript"
xPositionCell, Myx, Myy, Myz, 0, MyCell
Myref->xAddspell "HV_RM_MT_Targetscript"
set DoOnce to 0
stopscript "HV_RMMT_MakeTarget2"
return
endif
end