Lua code problems
So I'm working on a australia mod (aussie) and I'm trying to make a brebong (cassowary plum) tree for taming cassowarys. i based it off of the default tree api and at this string of code
It gives me this error
thanks in advance
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_abm({
nodenames = {"aussie:brebongsapling"},
interval = 10,
chance = 50,
action = function(pos, node)
if not default.can_grow(pos) then
return
end
local mapgen = minetest.get_mapgen_params().mgname
if node.name == "aussie:brebongsapling" then
minetest.log("action", "A sapling grows into a Brebong tree at "..
minetest.pos_to_string(pos))
if mapgen == "v6" then
default.grow_tree(pos, random(1, 4) == 1)
else
default.grow_new_brebong_tree(pos)
end
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
2016-03-05 00:13:58: ERROR[Main]: ModError: Failed to load and run script from /home/cp/.minetest/mods/aussie/init.lua:
2016-03-05 00:13:58: ERROR[Main]: /home/cp/.minetest/mods/aussie/trees.lua:154: 'end' expected (to close 'function' at line 33) near '<eof>'
2016-03-05 00:13:58: ERROR[Main]: stack traceback:
2016-03-05 00:13:58: ERROR[Main]: [C]: in function 'dofile'
2016-03-05 00:13:58: ERROR[Main]: /home/cp/.minetest/mods/aussie/init.lua:3: in main chunk
2016-03-05 00:13:58: ERROR[Main]: Check debug.txt for details.