Here is my script:
scn SSSGunnySackContScript;=+= Requires FOSE v1int iActStateint iButtonfloat fIW1float fIW2float fGSWBegin OnActivate PlayerIf SSSGunnySackContStasisRef.iActState == 1 Set fGSW to SSSGunnySackContStasisRef.fGSIW Set SSSGunnySackContStasisRef.iActState to 2EndIfShowMessage SSSGunnySackContMessageSet iActState to 1EndBegin GameModeIf iActState != 0 If iActState == 1 Set iButton to GetButtonPressed If iButton > -1 If iButton == 0 Set fIW1 to Player.GetAV InventoryWeight Activate Player 0 Set iActState to 2 Return ElseIf iButton == 1 If fGSW != SSSGunnySackContStasisRef.fGSIW Set SSSGunnySackContStasisRef.fGSIW to fGSW Set fGSW to (fGSW + 0.1) SetWeight fGSW SSSGunnySackMisc EndIf RemoveAllItems SSSGunnySackContStasisRef, 1 Player.AddItem SSSGunnySackMisc 1 1 Set SSSGunnySackContStasisRef.iActState to 0 Set iActState to 0 Disable MarkForDelete EndIf EndIf EndIf If iActState == 2 Set fIW2 to Player.GetAV InventoryWeight If fIW1 != fIW2 Set fIW1 to (fIW1 - fIW2) Set fGSW to (fGSW + fIW1) EndIf Set iActState to 0 EndIfEndIfEnd
This script is attached to my Gunny Sack temporary container (the one the player interacts with).
If a NPC activates the container, the "ShowMessage SSSGunnySackContMessage" line fires, and the message box pops up on my screen.
The NPC is usually pretty determined to get in to the container. This results in the Message popping up, and my selecting "Cancel". Message pops up, click cancel. Message pops up, click cancel.... you get the point.
What am I doing wrong?
How do I rig this OnActivate block to only fire for the PC, and not for NPCs?