There are a few ways this might be handled, depending on how you want the effect to appear. It is not clear if you expect players with resistance to fire or frost due to race, spell or potion effects to still be vulnerable to this damage.
I tested one approach requiring three scripts (for the cold room).
I used Arrille's Tradehouse for my test cell.
I created an amulet and gave it a custom frost resistance enchantment of 0%. (This displays the frost protection icon, but it will not offer any real frost protection except for the room's effects. You can make it a proper frost resistance enchantment if you wish.)
A script on the amulet checks to see if it is equipped, and writes that value to a global variable.
In my test, the global variable is cyr_amuletEquipped, but you rename it as appropriate.
I placed an invisible activator in the cold room (Arrille's Tradehouse).
A script on the activator starts a global script that applies the frost damage. (In this solution, the global script is necessary to remove the damage effect after the player leaves the cell. It could be handled differently if you don't care about the player experiencing the frost damage effect.)
The global script reads the value of the global variable and add/removes a custom frost damage curse. (This needs to be a curse, since a spell is merely added to the player's spell list, and an ability damages both the current health and the base health.)
Using spells rather than scripted damage may make it vulnerable to cures and dispels - another tradeoff for enjoying the actual spell effect.
My custom frost curse does 1 point of damage, but you can make it greater if you wish.
The amulet's script:
Spoiler Begin cyr_AmuletProtectionScript
; Attached to amulet cyr_exquisite_amulet.
; Checks to see if amulet is equipped, and if it is prevents the
; player from suffering frost damage while in Arrille's Tradehouse.
; short cyr_amuletEquipped ; global variable
short OnPCEquip
if ( menumode == 1 )
return
endif
if ( cyr_amuletEquipped == 0 )
if ( OnPCEquip == 1 )
set cyr_amuletEquipped to 1
endif
elseif ( cyr_amuletEquipped == 1 )
if ( OnPCEquip == 0 )
set cyr_amuletEquipped to 0
endif
endif
End
The invisible activator's script:
Spoiler Begin cyr_ArrillesTradehouseScript
; Attached to hidden activator cyr_hAct_ArrillesTradehouse.
; Starts global script that determines if the player suffers frost damage.
if ( ( ScriptRunning "cyr_GlobalFrostDamageScript" ) == 0 )
StartScript "cyr_GlobalFrostDamageScript"
endif
End
The global script:
Spoiler Begin cyr_GlobalFrostDamageScript
; Global script started by script cyr_ArrillesTradehouseScript.
; Checks to see if amulet is equipped, and causes the player to suffer frost damage
; if not wearing amulet while in Arrille's Tradehouse.
; short cyr_amuletEquipped ; global variable
short spellAdded
if ( ( GetPCCell "Seyda Neen, Arrille's Tradehouse" ) == 0 )
if ( spellAdded == 1 )
set spellAdded to 0
player->RemoveSpell "cyr_FrostDamage"
endif
StopScript "cyr_GlobalFrostDamageScript"
return
endif
if ( cyr_amuletEquipped == 0 )
if ( spellAdded == 0 )
set spellAdded to 1
player->AddSpell "cyr_FrostDamage"
endif
elseif ( cyr_amuletEquipped == 1 )
if ( spellAdded == 1 )
set spellAdded to 0
player->RemoveSpell "cyr_FrostDamage"
endif
endif
End
Obviously you will tailor these scripts for your circumstances, and create a similar set of scripts for the hot room. You may be able to use them as a guide if you want to use a different approach than the one I tested. Or simply clarify your needs and I or someone else will help you make the necessary adjustments.