Since some code is the same for, is they a way to make a reusable function, where the mod passes the information such as Position and Node name to the function.
Example;
1. Wood scaffolding Node sends the information to the function (node, pos)
2. The function puts uses the values given to it
below is what I have so far
Code: Select all
local scaffolfing = function (node, pos)
-- code for the building
end
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
if itemstack:get_name() == "scaffolding:platform" then
scaffolfing = function(node, pos)
end
end
end,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
if itemstack:get_name() == "scaffolding:platform" then
scaffolfing = function(node)
end
end
end,
[/code]