Page 1 of 1

"on_use"'s Function Problem

PostPosted: Thu Mar 29, 2012 10:14
by LorenzoVulcan
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.register_craftitem("electricforge:flintnsteel", {
    image = "if_flintnsteel.png",
    on_place_on_ground = minetest.craftitem_place_item,
    on_use=function(item, player, pointed_thing)
        print("Hello fire")
        --nodepos = {x = pos.x, y = pos.y + 1, z = pos.z}
            if pointed_thing.type == "node" then
        minetest.env:add_node(pointed_thing.above, { name='electricforge:fire' } )
            end
    return false
end

})

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
12:13:22: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: Expecting itemstack, itemstring, table or nil
12:13:22: ERROR[ServerThread]: stack traceback:


Any suggestion to resolve this?Thanks.

PostPosted: Thu Mar 29, 2012 12:35
by bgsmithjr
remove return false

PostPosted: Thu Mar 29, 2012 13:50
by LorenzoVulcan
bgsmithjr wrote:remove return false

Thanks!Solved.