Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Find node part
- minetest.register_chatcommand("findnode", {
- params = "<node>",
- description = "Search for nodes in radius 100",
- func = function(name, param)
- local player = minetest.localplayer
- if not player and not minetest.localplayer then
- return
- end
- local pos = player:get_pos()
- local node_name = param
- local node_pos = minetest.find_node_near(pos, 100, node_name, true)
- if not isBlank(node_pos) then
- if not disabled_message then
- minetest.display_chat_message("Node found at: " .. dump(node_pos))
- else
- huds["findnode"] = player:hud_add({
- hud_elem_type = "text",
- position = {x = 0.5, y = 0},
- offset = {x = -180, y = 0},
- text = dump(node_pos),
- alignment = 0,
- scale = {x = 50, y = 10},
- number = 0xFFFFFF,
- })
- minetest.after(6, function()
- player:hud_remove(huds["findnode"])
- end)
- end
- else
- if not disabled_message then
- minetest.display_chat_message("Node NOT found.")
- end
- end
- end,
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement