Page 1 of 1

I need a little help

PostPosted: Sat Jul 14, 2012 05:38
by InfinityProject
I'm making a crossbow mod and want a crossbow that when it shoots a bolt that bolt produces fire on contact with a node.
What I have:
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.env:add_item(self.lastpos, fire.on_flame_add_at(pos))


But there's a bug:
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
ServerError: LuaError: error running function 'on_step':
...attempt to index global 'fire' (a nil value)

PostPosted: Sat Jul 14, 2012 08:32
by Jordach
InfinityProject wrote:I'm making a crossbow mod and want a crossbow that when it shoots a bolt that bolt produces fire on contact with a node.
What I have:
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.env:add_item(self.lastpos, fire.on_flame_add_at(pos))


But there's a bug:
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
ServerError: LuaError: error running function 'on_step':
...attempt to index global 'fire' (a nil value)

Because, remove fire and place "function" in, you are trying to declare something that does not exist. Or the function bit could be wrong, I got this last night.

PostPosted: Mon Jul 16, 2012 21:23
by InfinityProject
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.env:add_item(self.lastpos, function on_flame_add_at(pos))

This is what I tried but it didn't work. I feel like it needs more info.