Jump to content

Any idea whats wrong with this script?


ashjay101

Recommended Posts

Hi all,

 

so, for a mod Im currently working on, im trying to make a script that will remove all items from all companions once they enter a trigger, then add them back when they leave the cell:

 

scn CFEECasinoTestSCRIPT1
short ConfiscatedCompanions
ref Companion1
ref Companion2
ref Companion3
ref Potential1
ref potential2
ref potential3
short DoOnce
Begin GameMode
if DoOnce != 1
set Companion1 to 0
set Companion2 to 0
set Companion3 to 0
set confiscatedcompanions to 0
set DoOnce to 1
endif
end
Begin OnTrigger
If (ConfiscatedCompanions == 0)
If (GetActionREF != Player)
set potential1 to GetActionREF
If (Potential1.GetPlayerTeammate == 1)
set companion1 to Potential1
set ConfiscatedCompanions to 1
Companion1.RemoveAllItems CFEEComp1CONT
endif
endif
endif
end
Begin OnTrigger
If (ConfiscatedCompanions == 1)
If (GetActionREF != Player)
set potential2 to GetActionREF
If (Potential2.GetPlayerTeammate == 1)
set companion2 to Potential2
set ConfiscatedCompanions to 2
Companion2.RemoveAllItems CFEEComp2CONT
endif
endif
endif
end
Begin OnTrigger
If (ConfiscatedCompanions == 2)
If (GetActionREF != Player)
set potential3 to GetActionREF
If (Potential3.GetPlayerTeammate == 1)
set companion3 to Potential3
set ConfiscatedCompanions to 3
Companion3.RemoveAlltems CFEEComp3CONT
endif
endif
endif
end
Begin GameMode
if (Player.GetInCell CFEECellName != 1)
if (Companion1 != 0)
CFEEComp1CONT.removeallitems Companion1
endif
if (Companion2 != 0)
CFEEComp2CONT.removeallitems Companion2
endif
if (Companion3 != 0)
CFEEComp3CONT.removeallitems Companion3
endif
set Companion1 to 0
set Companion2 to 0
set companion3 to 0
set confiscatedcompanions to 0
endif
end
This is all the script for the trigger
The companions don;t always recover their items, that may be because I have to have the script as part of a trigger, is there any way anyone knows of using Companion1 in other scripts e.g. a quest script?
Can anyone spot any other problems with this?
Thanks
Link to comment
Share on other sites

  • Recently Browsing   0 members

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