Guest User

lua code for minetest

a guest
Sep 5th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. minetest.register_on_punchnode(function (pos, node, puncher)
  2.     if string.find(node.name, "jumping:trampoline") then
  3.         local id = string.sub(node.name, #node.name) --get number
  4.         local name = puncher:get_player_name() --get puncher's name
  5.         id = id + 1
  6.         if id == 7 then id = 1 end
  7.         minetest.env:add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
  8.         minetest.chat_send_player(name, "Setting: "..id) --tell the puncher what setting the trampoline is
  9.     end
  10. end)
Advertisement
Add Comment
Please, Sign In to add comment