I want an 'on_rightclick' action on mesescons node, I have this code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if node.name == "mesecons_switch:mesecon_switch_off" then
local player_name = clicker:get_player_name()
local mypos = minetest.pos_to_string(pos)
minetest.chat_send_all(player_name .." is right-click on me. I'm located at ".. mypos)
end
end
But it doesn't run... O_o
Do you have an good example?
Thank you