Trying to lock a building door



I’m trying to lock a building door, but i can’t get it to work. Ifsomeone could point me into the right direction …

i’m using : FreezeEntityPosition(“1557126584”, true) and also tried it with the object name instead of the hash id with no success.


That is not a local entity id.

The object id that you find here: [](http://)

is just a “model” id. So those two things are not the same.

You should check for the closest object around you in a loop with the exact model id (1557126584) and then you should use the local id of the object to freeze it.

This function should help you with the code:


Gotcha, thanks a lot got it working now


Also, you might want to rethink the locking code. The door could be angled when the player locks the door and it would stay like that until it is unlocked. You need to check if the door is closed (in it’s primary position).