Guest User

Untitled

a guest
Jun 5th, 2014
265
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. minetest.register_craftitem("mtz_tests:treespawner", {
  2. description = "Test Experimental Tree",
  3. inventory_image = "default_stick.png",
  4. on_use = function(itemstack, user, pointed_thing)
  5. local playername = user:get_player_name()
  6. local hasprivs = minetest.check_player_privs(playername, {tester=true})
  7. if hasprivs == true then
  8. print("Privs ok for " .. playername)
  9. end
  10. if (hasprivs == true) and (pointed_thing.type == "node") then
  11. local pos = pointed_thing.above
  12. minetest.env:spawn_tree(pos, experimental_tree)
  13. end
  14. end
  15. })
RAW Paste Data