Code: Select all
cloneObject {
name = "weak_cube",
baseObject = "cube",
health = 30,
exp = 100,
attackPower = 5,
onDamage = function(monster, damage)
return true
end,
}
Code: Select all
cloneObject {
name = "weak_cube",
baseObject = "cube",
health = 30,
exp = 100,
attackPower = 5,
onDamage = function(monster, damage)
return true
end,
}
Code: Select all
onDamage = falseCode: Select all
onDamage = function()
endI commented everything else out except for the first two lines, just to see if my function was messed up, and it still crashed the editor. I wasn't planning on having my cube be that weak, I was just using low numbers for testing so that I could get it working, but I haven't gotten past that point yet.Montis wrote:There's no such thing as a weak cube!![]()
Seriously though, I think what's wrong here is that "return true" doesn't work here.
Can you try the following (I'm unable to test at the moment):
With that you should be able to "reset" all previously written statements in the onDamage hook.Code: Select all
onDamage = false
If that doesn't work you can also try:
Code: Select all
onDamage = function() end