With this plugin, only cupboard placer (owner) can place codelock to that cupboard, with this way admins can stop base takeovers.
Rust My Code Lock My CupBoard
Discussion in 'Plugin Requests' started by GLasiore, Aug 15, 2017.
-
NoRaid for Rust | Oxide This is a good alternative if you want to stop raiding all together.
-
I don't want to stop raiding, I want to stop takeovers
-
I just had a play around with this, it seems the only viable hook that could be used is OnEntitySpawned to then check the codelocks parent. But as far as I can tell it doesn't have a parent when it's spawned, it's maybe being called to early.
There's a hook called "CanLock" but that doesn't get called when the codelock is locked by entering the code. So not quite sure if this is possible without a new hook addition of something along the lines of "CanPlaceLock" maybe. Not entirely sure.
There's always the option to raycast around the codelocks position when it spawns I guess. -
Maybe we can ask for it, if it is something easy.
-
Code:
OnItemDeployed
-
You can probably also use a raycast see if the player is looking at a cupboard, and see if he/she is holding a codelock via activeItem, when a player left clicks of course.