| Is there a way to prevent some invocations? |
| « Citoyen » 1443374460000
| 0 | ||
| Hi guys! Today I'm making a LUA script and I'd like to know if there's a way to prevent some invocations. I've tried 2 methods and they didn't work. I'm testing with the cannons, which id is 17: First one: Trying to return false with the function 'eventSummoningStart': a dit : Since that didn't work I tried to remove the object after it's invocated, but it neither worked a dit : Do you have any idea? Or maybe an alternative. |
| « Consul » 1443375480000
| 0 | ||
| The API's events are independently called from the game's, returning something in them serves no purpose making your first example a bit useless. As for your second script, it could work but there's a couple of things wrong with it. The second argument which you've named "object" is just the type of object (in this case you're detecting if the type is cannon). The ID of the spawned object you use to remove it is separate from that though, in this case it's located with the key "id" in the last argument of the function, which you've named "table". Since "table" is already a variable name in Lua it'd be best to avoid calling it that in any scope, so I'll change the name here to "other". Since returning any values through events are useless and physic objects are grounds (not shaman objects), those two lines can be removed too. a dit : It's still not a perfect solution, as there's a bit of delay before the object is removed, which means you can still use the momentum from it briefly as it's spawned, but it's the best you'll get unless you consider other solutions such as killing the shaman on eventSummoningStart. |
| « Citoyen » 1443375960000
| 0 | ||
| Nvm Im too slow xP -hides- Also, there is no 'object2' argument. a dit : Dernière modification le 1443376740000 |