(previous problem solved)
Another problem: when I place screen5, screen4 appears to the left of it as planned, but instead of appearing to the right, screen6 appears in place of screen5. Here is the 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
after_place_node = function(pos,placer,itemstack)
local param2 = minetest.get_node(pos).param2
if param2 == 0 then
pos.x = pos.x-1
minetest.set_node(pos,{name="plasmascreen:screen4", param2=minetest.dir_to_facedir(placer:get_look_dir())})
elseif param2 == 1 then
pos.z = pos.z+1
minetest.set_node(pos,{name="plasmascreen:screen4", param2=minetest.dir_to_facedir(placer:get_look_dir())})
elseif param2 == 2 then
pos.x = pos.x+1
minetest.set_node(pos,{name="plasmascreen:screen4", param2=minetest.dir_to_facedir(placer:get_look_dir())})
elseif param2 == 3 then
pos.z = pos.z-1
minetest.set_node(pos,{name="plasmascreen:screen4", param2=minetest.dir_to_facedir(placer:get_look_dir())})
end
local param2 = minetest.get_node(pos).param2
if param2 == 0 then
pos.x = pos.x+1
minetest.set_node(pos,{name="plasmascreen:screen6", param2=minetest.dir_to_facedir(placer:get_look_dir())})
elseif param2 == 1 then
pos.z = pos.z-1
minetest.set_node(pos,{name="plasmascreen:screen6", param2=minetest.dir_to_facedir(placer:get_look_dir())})
elseif param2 == 2 then
pos.x = pos.x-1
minetest.set_node(pos,{name="plasmascreen:screen6", param2=minetest.dir_to_facedir(placer:get_look_dir())})
elseif param2 == 3 then
pos.z = pos.z+1
minetest.set_node(pos,{name="plasmascreen:screen6", param2=minetest.dir_to_facedir(placer:get_look_dir())})
end
end
})
Everything before the first "end" works fine.
Also, the nodes I place aren't being saved when I exit the world, although it is recorded in the terminal.