Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local old_on_rightclick = minetest.registered_nodes["default:chest"].on_rightclick
  2. minetest.override_item("default:chest_shared", {
  3.     on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
  4.         local name = clicker:get_player_name()
  5.         if minetest.is_protected(pos,name) then
  6.             minetest.chat_send_all(name,"You cannot use this shared chest, because you are not part of the protection.")
  7.             return itemstack
  8.         end
  9.         old_on_rightclick(pos, node, clicker, itemstack, pointed_thing)
  10.     end
  11. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement