Disco ball

  • vertigo
    28th Jun 2012 Member 0 Permalink

    Im new and all i started yesterday, so please point out any indentation errors, or tips. Disco ball element code:

    tpt.el.bran.name="DSCO"
    tpt.el.bran.enabled=1
    tpt.el.bran.menu=1
    tpt.el.bran.menusection=10
    tpt.el.bran.description="Disco ball!"
    tpt.el.bran.heat=300
    function Discoball()
       x=math.random(1,999999)
       tpt.el.bran.color=x
    end
    tpt.register_step(Discoball)

     

    @mniip i hope this doesnt look like a config file ^^. Im getting better at it.

     

    Edit: I did not want to make another post, here is the code for "Destruction" script:

     

    function destruction()
       x = math.random(0, 611)
       y = math.random(0, 383)
       tpt.create(x, y, "dest")
       z = math.random(0, 611)
       w = math.random(0, 383)
       tpt.create(z, w, "bomb")
       r = math.random(0, 611)
       v = math.random(0, 383)
       tpt.create(r, v, "thdr")
    end
    tpt.register_step(destruction)

     

    It randomly creates dest/bomb/thdr all over the screen. It is very destructive.