Unlocking an object with script?

Devis
06 Jun 2012, 15:43
Hi, how can I use a script expression to unlock an object? I have a key that unlocks a chest and under The "use/give" tab I have set it so that a key can be used on the chest, but I need it to unlock the chest.

I tried "this.unlock" but can't seem to get it to work....

Thanks

Pertex
06 Jun 2012, 17:23
I think it's
containername.locked=false

Devis
06 Jun 2012, 18:20
That does'nt seem to work. Im not sure if im using the correct scrpt thing, im using "unlock exit" with expression then entering the code. Am I doing this correct?

Also does any one know how to change whether an object is a scenery object or not using a script function?


Update: Ok right it does work, I was just using the wrong script command. And I figured the scenery script was "object.scenery=false"

Problem solved :D