Im trying to make a flashbang with this code...
elem.property(fb, "Update", function (i,x,y,s,n)
-- Element logics not included
graphics.fillRect(5,5,graphics.WIDTH, graphics.HEIGHT)
sim.partProperty(i, "life", sim.partProperty(i, "life") - 1)
if sim.partProperty(i, "life") ~= nil and sim.partProperty(i, "life") == 0 then sim.partKill(i); end
end)
No matter how i change the code (Even, i tried to use the legacy tpt. API), it will ONLY flash white when i use an (tick) event hook. But also, when i try to unhook that event, it will keep going... Help!
What if you combine the two and register the tick event when created, and then unregister the tick event when life goes to 0? (I didn't test this, my screen went white after I used the tick event hook)