scn aaDoorCheckScript
ref dolor
ref dolor2
int optionsup
int buttonpressedX
int msgvar1
int showmenu
int chance1
int lskill
Begin GameMode
if player.getav lockpick > 100 && player.issneaking == 1
set dolor to GetCrosshairRef
set lskill to player.getav lockpick
set chance1 to 25 + ( ( lskill - 100 ) / 2 )
if chance1 < 25
set chance1 to 25
elseif chance1 > 75
set chance1 to 75
endif
set msgvar1 to chance1
if dolor.getlocklevel == 255 && dolor != dolor2
set dolor2 to dolor
set showmenu to 1
endif
if showmenu == 1
showmessage aaEpicUnlockMSG msgvar1
set optionsup to 1
set showmenu to 0
endif
if optionsup == 1
set buttonpressedX to getbuttonpressed
if buttonpressedX == 0
if getrandompercent < chance1
dolor2.unlock
showmessage aaSuccess
dolor2.ListAddRef aaDoorsUnlocked
else
showmessage aaFailure
dolor2.ListAddRef aaDoorsUnlocked
endif
set optionsup to 0
elseif buttonpressedX == 1
set optionsup to 0
endif
endif
endif
End
ref dolor
ref dolor2
int optionsup
int buttonpressedX
int msgvar1
int showmenu
int chance1
int lskill
Begin GameMode
if player.getav lockpick > 100 && player.issneaking == 1
set dolor to GetCrosshairRef
set lskill to player.getav lockpick
set chance1 to 25 + ( ( lskill - 100 ) / 2 )
if chance1 < 25
set chance1 to 25
elseif chance1 > 75
set chance1 to 75
endif
set msgvar1 to chance1
if dolor.getlocklevel == 255 && dolor != dolor2
set dolor2 to dolor
set showmenu to 1
endif
if showmenu == 1
showmessage aaEpicUnlockMSG msgvar1
set optionsup to 1
set showmenu to 0
endif
if optionsup == 1
set buttonpressedX to getbuttonpressed
if buttonpressedX == 0
if getrandompercent < chance1
dolor2.unlock
showmessage aaSuccess
dolor2.ListAddRef aaDoorsUnlocked
else
showmessage aaFailure
dolor2.ListAddRef aaDoorsUnlocked
endif
set optionsup to 0
elseif buttonpressedX == 1
set optionsup to 0
endif
endif
endif
End
scn aaDoorLockScript
ref dolor
ref dolor2
int optionsup
int buttonpressedX
int msgvar1
int showmenu
int chance1
int lskill
int day1
int day2
int doOnce
int tries
Begin GameMode
set day1 to GameDaysPassed
if player.getav lockpick > 100 && player.issneaking == 1
set dolor to GetCrosshairRef
set lskill to player.getav lockpick
set lskill to (lskill - 100)
if lskill > 99
set lskill to 99
elseif lskill < 0
set lskill to 0
endif
if day2 != day1
set tries to 1
endif
if doOnce != 2
set tries to 1
set doOnce to 2
endif
if dolor.getlocked == 0 && dolor != dolor2 && tries != 0
set dolor2 to dolor
set showmenu to 1
endif
if showmenu == 1
showmessage aaEpicLockMSG
set optionsup to 1
set showmenu to 0
endif
if optionsup == 1
set buttonpressedX to getbuttonpressed
if buttonpressedX == 0
dolor2.lock lskill
set tries to 0
elseif buttonpressedX == 1
set optionsup to 0
endif
endif
endif
set day2 to day1
End
ref dolor
ref dolor2
int optionsup
int buttonpressedX
int msgvar1
int showmenu
int chance1
int lskill
int day1
int day2
int doOnce
int tries
Begin GameMode
set day1 to GameDaysPassed
if player.getav lockpick > 100 && player.issneaking == 1
set dolor to GetCrosshairRef
set lskill to player.getav lockpick
set lskill to (lskill - 100)
if lskill > 99
set lskill to 99
elseif lskill < 0
set lskill to 0
endif
if day2 != day1
set tries to 1
endif
if doOnce != 2
set tries to 1
set doOnce to 2
endif
if dolor.getlocked == 0 && dolor != dolor2 && tries != 0
set dolor2 to dolor
set showmenu to 1
endif
if showmenu == 1
showmessage aaEpicLockMSG
set optionsup to 1
set showmenu to 0
endif
if optionsup == 1
set buttonpressedX to getbuttonpressed
if buttonpressedX == 0
dolor2.lock lskill
set tries to 0
elseif buttonpressedX == 1
set optionsup to 0
endif
endif
endif
set day2 to day1
End
To my knowledge these scripts are saying that whenever a game is loaded these scripts are running and that when they are running anything the crosshair is over will cause aaEpicLockMSG to appear.
GetCrosshairRef - Returns the reference under the crosshair - i.e., the reference that would be activated if the player pressed the Activate button. Will return non-activatable items (like tables and trees) as long as they are within activation distance. Otherwise returns zero
.