Advertisement
Guest User

Untitled

a guest
Aug 15th, 2023
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1.     on_punch = function(pos, node, puncher, pointed_thing) 
  2.         if puncher:is_player() then
  3.             print(puncher:get_player_name() .. " pounded the alarm at ")
  4.             print(pos)
  5.         end
  6.        
  7.         local setchan = minetest.get_meta(pos):get_string("channel")
  8.        
  9.         rules = {{x=0,  y=0,  z=-1}, -- taken from digilines.default.rules thing
  10.             {x=1,  y=0,  z=0},
  11.             {x=-1, y=0,  z=0},
  12.             {x=0,  y=0,  z=1},
  13.             {x=1,  y=1,  z=0},
  14.             {x=1,  y=-1, z=0},
  15.             {x=-1, y=1,  z=0},
  16.             {x=-1, y=-1, z=0},
  17.             {x=0,  y=1,  z=1},
  18.             {x=0,  y=-1, z=1},
  19.             {x=0,  y=1,  z=-1},
  20.             {x=0,  y=-1, z=-1}}
  21.            
  22.         digilines:receptor_send(pos, rules, setchan, "fire")
  23.        
  24.         -- TODO: store the name of the puncher in somewhere permanent
  25.     end,
  26.  
  27. -- Breaks and gives:
  28.  
  29. AsyncErr: Lua: Runtime error from mod 'firesafety' in callback node_on_punch(): /tmp/.mount_MineteFpGKBh/usr/bin/../builtin/game/misc_s.lua:13: attempt to perform arithmetic on field 'z' (a nil value)
  30. stack traceback:
  31.     /tmp/.mount_MineteFpGKBh/usr/bin/../builtin/game/misc_s.lua:13: in function 'hash_node_position'
  32.     /home/independent/.minetest/mods/digilines/init.lua:50: in function 'receptor_send'
  33.     ...dent/.minetest/mods/mymods/fire_safety_new/fireboxes.lua:57: in function <...dent/.minetest/mods/mymods/fire_safety_new/fireboxes.lua:36>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement