ashjay101 Posted September 26, 2021 Share Posted September 26, 2021 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 ConfiscatedCompanionsref Companion1ref Companion2ref Companion3ref Potential1ref potential2ref potential3short DoOnce Begin GameModeif DoOnce != 1set Companion1 to 0set Companion2 to 0set Companion3 to 0set confiscatedcompanions to 0set DoOnce to 1endifend Begin OnTrigger If (ConfiscatedCompanions == 0)If (GetActionREF != Player)set potential1 to GetActionREFIf (Potential1.GetPlayerTeammate == 1)set companion1 to Potential1set ConfiscatedCompanions to 1Companion1.RemoveAllItems CFEEComp1CONT endifendifendifend Begin OnTriggerIf (ConfiscatedCompanions == 1) If (GetActionREF != Player)set potential2 to GetActionREFIf (Potential2.GetPlayerTeammate == 1)set companion2 to Potential2set ConfiscatedCompanions to 2Companion2.RemoveAllItems CFEEComp2CONTendifendifendifend Begin OnTriggerIf (ConfiscatedCompanions == 2) If (GetActionREF != Player)set potential3 to GetActionREFIf (Potential3.GetPlayerTeammate == 1)set companion3 to Potential3set ConfiscatedCompanions to 3Companion3.RemoveAlltems CFEEComp3CONTendifendifendifend Begin GameModeif (Player.GetInCell CFEECellName != 1) if (Companion1 != 0)CFEEComp1CONT.removeallitems Companion1endif if (Companion2 != 0)CFEEComp2CONT.removeallitems Companion2endif if (Companion3 != 0)CFEEComp3CONT.removeallitems Companion3endif set Companion1 to 0set Companion2 to 0set companion3 to 0set confiscatedcompanions to 0 endifend 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 More sharing options...
ashjay101 Posted September 27, 2021 Author Share Posted September 27, 2021 All working now :) Link to comment Share on other sites More sharing options...
Recommended Posts