Skip to content

Instantly share code, notes, and snippets.

@rubenwardy
Last active February 14, 2017 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenwardy/9d5aa4cc87a45fd790bd546e62af2094 to your computer and use it in GitHub Desktop.
Save rubenwardy/9d5aa4cc87a45fd790bd546e62af2094 to your computer and use it in GitHub Desktop.
-- in definition of node A
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node(pos, { name = "nodeBName", param2 = node.param2 })
minetest.after(2, minetest.set_node, pos, { name = "nodeCName", param2 = node.param2 })
end,
@GreenXenith
Copy link

GreenXenith commented Feb 14, 2017

This is the code I have on nodeA, turning it into nodeB

on_punch = function(pos, node, puncher, pointed_thing)
	minetest.set_node(pos, {name = "waffles:wafflemaker_closed_full", param2 = node.param2})
end

This is for nodeB, which only works after player places, and not when the above code is called.

after_place_node = function(pos, placer, itemstack, pointed_thing)
	local node = minetest.get_node(pos) 
	minetest.after(2.0, replace_donemodel, pos, node)
end`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment