here's the WIP 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
--License "Bovvered" Like Wtfpl but with more catherine tate. JK i'll think of a license later
minetest.register_node("lookout:lookout_stone", {
description = "a portable looking tool",
tile_images = {"moreblocks_stonebrick.png"}, --place holder image
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
driver = nil,
on_timer = function(pos, elapsed)
clicker = minetest.env.get_player_by_name(driver.get_player_name())
driver = nil
clicker:set_physics_override(1, 1, 1)
clicker:set_look_pitch(0)
clicker:setpos(pos)
end,
on_rightclick = function(pos, node, clicker)
if not clicker:is_player() then
return
end
if driver and clicker == driver then
driver = nil
clicker:set_physics_override(1, 1, 1)
clicker:set_look_pitch(0)
clicker:setpos(pos)
elseif not driver then
driver = clicker
pos.y = pos.y + 5
clicker:set_physics_override(0, 0, 0)
clicker:set_look_pitch(math.pi*1)
clicker:setpos(pos)
set(5, 0)
end
end
})
in line 36, I have tried "set(5,0)" "node.set(5,0)" "self.set(5,0)" "node:set(5, 0)" "start(5)" etc...
and I'm still getting this error message: attempt to call global 'set' (a nil value)
when as I understand the documentation it should be calling the on_timer method
Minetest 0.4.7... Ubuntu 13.04 running LXDE desktop