Hello once again. Thanks to Healthire, I've finally managed to found the problem, and a kind of solution, you can find the working mod attached to this post. Working script: Code: local preSpamUpdate = update function update(dt) preSpamUpdate(dt) sb.logInfo("I'm a Poptop!") end local preSpamRequire = require function require(s) if s ~= "/monsters/monster.lua" then preSpamRequire(s) end end First part saves the monster "update(dt)" function in the "preSpamUpdate", then overrides the "update(dt)" functions with the new behaviour, for our example, logging "I'm a Poptop!" Second part is the critical one, it starts similar to the first, saving "require(s)" function in the "preSpamRequire", then overriding it. In the overrided version, we BLOCK the reload of "monster.lua", why? The process is as follows: "monster.lua", the primary monster script is loaded. "poptopspam.lua", our script is loaded, it overrides the "update(dt)" function of "monster.lua" All behaviors are loaded, included their scripts, witch might require again, "monster.lua". If not blocked, "monster.lua" is loaded AGAIN, overriding the "update(dt)" function of "poptopspam.lua" Working patch: Code: [ { "op" : "add", "path" : "/baseParameters/scripts/-", "value" : "/scripts/poptopspam.lua" } ] Pretty self explanatory, we just append our script to the "/baseParameters/scripts" array.
Do anyone know how to implement his using a new monster behavior? That will improve the solution, since i no longer need to avoid "monster.lua" reload.
No, to edit monster drops, you need to do another entirely different thing, that is out of the scope of this thread. Just to point you in the right direction, you can take a look at "Mudercraft" code, witch modifies monster's drops to add "blood" ad a drop. This modification is to do things like this: The problem now is that the way I've managed to do it seems a bit "dirty", and I want to do it using a new monster behavior instead of a script.