I mentioned that in question on a thread titled "Question to Frans users" but I should ask perhaps people who knows a bit about scripts in Oblivion.
I wonder if this is well written script (will it work):
Spoiler
begin OnReset
set Done to 0
set Trapped to 0
set NeedsKey to 0
end
begin OnLoad
if Done == 0
set Done to 1
set LType to GetLockLevel
set Rand to GetRandomPercent
if Rand <= (5 + FranLoot.ChestKey)
set Difficulty to (25 + (GetRandomPercent * 0.75))
set NeedsKey to 1
set Trapped to Difficulty / 33
set ModStat to Difficulty/4
set Reward to Difficulty/15
set KeyKeeper to PlaceAtMe FranLL00NPCNecro, 1
KeyKeeper.AddItem FranKeyNecro, 1
KeyKeeper.AddScriptPackage aaaDefaultExploreCurrentLoc3000
KeyKeeper.ModAv Health Difficulty
KeyKeeper.ModAv Luck ModStat
KeyKeeper.ModAv Strength ModStat
KeyKeeper.ModAv Agility ModStat
KeyKeeper.ModAv Willpower ModStat
AddItem FranLLG0DungRandKeyMage, Reward
set Difficulty to (Difficulty - LType)
Lock Difficulty
elseif FranLoot.RandomizeLocks == 1
if GetLocked == 0 && Rand == 6 + FranLoot.ChestKey
Lock 75
elseif GetLocked == 0 && Rand < 9 + FranLoot.ChestKey
Lock 35
elseif GetLocked == 0 && Rand < 12 + FranLoot.ChestKey
Lock 18
elseif GetLocked == 0 && Rand < 16 + FranLoot.ChestKey
Lock 6
elseif GetLocked == 1 && Rand < 15 + FranLoot.ChestKey
Unlock
elseif GetLocked && GetLockLevel <= 80 && Rand > 75
set Rand to GetRandomPercent
set LockEasy to (18 - LType)
set LockAverage to (35 - LType)
set LockHard to (75 - LType)
set LockVeryHard to (95 - LType)
if LType <= 7 && Rand <= 75
Lock LockEasy
additem FranLLG2DungRandChestLev05, 1
additem FranLLG0DungRandTreasure, 1
elseif (LType <= 7 && Rand < 95) || (LType <= 20 && Rand <= 75)
Lock LockAverage
additem FranLLG2DungRandChestLev07, 1
additem FranLLG0DungRandTreasure, 1
elseif (LType <= 7) || (LType <= 20 && Rand < 95) || (LType <= 40 && Rand <= 75)
Lock LockHard
additem FranLLG2DungRandChestLev10, 1
additem FranLLG0DungRandTreasure, 1
elseif (LType <= 20) || (LType <= 40 && Rand > 75) || (LType > 40)
Lock LockVeryHard
additem FranLLG2DungRandChestLev15, 1
additem FranLLG0DungRandTreasure, 1
endif
endif
endif
if GetLocked && NeedsKey == 0 && GetRandomPercent <= (2 + FranLoot.ChestTrap)
set LType to GetLockLevel
set Trapped to LType / 33
endif
if FranLoot.ChestMArms == 1
additem FranSCL5LootArmorAll08, 1
additem FranSCL5LootWeaponAll08, 1
endif
if FranLoot.ChestMGems == 1
additem FranSCL0LootMoreGems15, 1
endif
if FranLoot.ChestMGold == 1 && GetRandomPercent >= 50
additem LL1LootGold100, 1
endif
endif
end
Begin OnActivate
set Actor To GetActionRef
if NeedsKey == 1 && Actor.GetItemCount FranKeyNecro >= 1
set NeedsKey to 0
set Trapped to 0
Actor.RemoveItem FranKeyNecro, 1
Unlock
Activate
elseif Trapped > 0
set LType to GetLockLevel
if Done == 1 && Actor == Player && Actor.GetAv Security > ((GetRandomPercent + LType) /2)
message "Something looks out of place in this chest.. it may be trapped!"
set Done to 2
elseif Done == 2 && Actor == Player && Actor.GetAv Security > ((GetRandomPercent + LType) /1.75)
message "You managed to disarm the trap, the chest can now be safely opened!"
set Done to 3
set Trapped to 0
else
set Rand to GetRandomPercent
if Trapped <= 1 && Rand < 50
cast StandardFrostDamageTarget3Journeyman Actor
cast StandardDrainFatigue3Journeyman Actor
elseif Trapped <= 1
cast StandardFireDamageTarget3Journeyman Actor
cast StandardDrainFatigue3Journeyman Actor
elseif Trapped <= 2 && Rand < 50
cast StandardShockDamageTarget4Expert Actor
cast FranDungTrapDFatigue4 Actor
elseif Trapped <= 2
cast StandardFrostDamageTarget4Expert Actor
cast FranDungTrapDFatigue4 Actor
elseif Trapped <= 3 && Rand < 50
cast StandardShockDamageTarget5Master Actor
cast FranDungTrapDFatigue5 Actor
elseif Trapped <= 3
cast StandardFireDamageTarget5Master Actor
cast FranDungTrapDFatigue5 Actor
endif
set Trapped to 0
if Done == 2 && Actor == Player
message "You failed to disarm the trap!"
elseif Actor == Player
message "The chest was trapped!"
elseif Actor != Player
Unlock
Activate
RemoveAllItems Actor
endif
endif
elseif Actor != Player
Unlock
Activate
RemoveAllItems Actor
else
Activate
endif
end
Because in my game, I don't remember any chests locked that would require a key (that key should be held by a key guardian NPC nearby). Francesco 5.0 comes with an ini file where a value is stored: FranLoot.ChestKey
I set that value quite high and still hasn't notice any key-locked chest.