Doesn't work and I have the same problem.
if msgcontains(msg, 'yes') then
selfSay('Alright, take this key to unlock the chest.', cid)
doSetItemActionId(doPlayerAddItem(cid, 2090, 1), 5006)
--setPlayerStorageValue(cid, 50006, 1)
::: EDIT :::
I found a way to bypass this :
if...