Singularity Bomb Script

  • QuentinADay
    16th Jul 2014 Member 0 Permalink

    local napalm = elements.allocate("QUENTIN", "SNGB")
    elements.element(elements.QUENTIN_PT_SNGB, elements.element(elements.DEFAULT_PT_BCOL))
    elements.property(elements.QUENTIN_PT_SNGB, "Name", "SNGB")
    elements.property(elements.QUENTIN_PT_SNGB, "Description", "Singularity Bomb.")
    elements.property(elements.QUENTIN_PT_SNGB, "Colour", 0x8A2E8A)
    elements.property(elements.QUENTIN_PT_SNGB, "MenuSection", 5)
    elements.property(elements.QUENTIN_PT_SNGB, "Gravity", 0)
    elements.property(elements.QUENTIN_PT_SNGB, "Flammable", 0)
    elements.property(elements.QUENTIN_PT_SNGB, "Explosive", 0)
    elements.property(elements.QUENTIN_PT_SNGB, "Loss", 0.15)
    elements.property(elements.QUENTIN_PT_SNGB, "AirLoss", 0.96)
    elements.property(elements.QUENTIN_PT_SNGB, "AirDrag", 0.03)
    elements.property(elements.QUENTIN_PT_SNGB, "Advection", 0)
    elements.property(elements.QUENTIN_PT_SNGB, "Weight", 32)
    elements.property(elements.QUENTIN_PT_SNGB, "Diffusion", 0)
    elements.property(elements.QUENTIN_PT_SNGB, "Falldown", 0)
    SINGUpdate = function(i, x, y, s, n)
     local clife = tpt.get_property('life', x, y)
     if clife > 1 then
     for cx = -1, 1, 2 do
     for cy = -1, 1, 2 do
     tpt.create(x + cx, y + cy, 'sing')
     end
     end
     tpt.set_property('life', clife - 1, x, y)
     elseif clife == 1 then
     tpt.set_property('type', 0, x, y)
     elseif s > 0 then
     for cx = -1, 1, 2 do
     for cy = -1, 1, 2 do
     if tpt.get_property('type', x + cx, y + cy) == 4 or tpt.get_property('type', x + cx, y + cy) == 49 then
     tpt.set_property('life', 100, x, y)
     return true
     end
     end
     end
     end
    end
    tpt.element_func(SINGUpdate, tpt.element('sngb'))

    function something(i,x,y,s,n)
        if math.random(1,50) == 25 then
            tpt.set_property("tmp", 99999, x + math.random(-1,1), y + math.random(-1,1))
            tpt.set_property("life", 0, x + math.random(-1,1), y + math.random(-1,1))
        end
    end
    tpt.element_func(something,tpt.el.sing.id)

    function explode(i,x,y,s,n)
        type = tpt.get_property("type", x + math.random(-3,3), y + math.random(-3,3))
        if type == elements.QUENTIN_PT_SNGB then
            tpt.parts[i].type = tpt.el.sing.id
        end
    end
    tpt.element_func(explode,tpt.el.fire.id)

  • Robinfox
    22nd Jul 2014 Member 0 Permalink

    [code]-script-[code]

  • QuentinADay
    22nd Jul 2014 Member 0 Permalink

    What...?

  • Kikkin
    22nd Jul 2014 Banned 0 Permalink
    This post is hidden because the user is banned
  • dom2mom
    22nd Jul 2014 Member 0 Permalink

    @QuentinADay (View Post)

     If you put your code in between [code] brackets (HTML) your script will appear in a plain text, easy to read format. Also, you can just put it on pastebin.com and put the link here.

  • Protcom
    22nd Jul 2014 Member 0 Permalink

    @QuentinADay (View Post)

    He means put your sctipt between <code> html tag like this

    <code>Hello</code>

    and that will appear like this

    Hello

     

     

    @Robinfox (View Post)

    @dom2mom (View Post)

    Wow, seems like no-one use "&+l+t+;" and "&+g+t+;" (without the plus mark "+") to not complete the pattern and it will still appear like this "<" and ">" .

    Edited once by Protcom. Last: 22nd Jul 2014
  • JjStAr992_Gaming
    29th Jul 2014 Member 0 Permalink

    Nice man, love this script! Just set the stuff off with some fire.

     

    However, sometimes it'll blurt out an unknown particle at line 18. Had a look and 'life' seems to be existent... But then again, I am a TPT Lua noob :P

  • QuentinADay
    3rd Aug 2014 Member 0 Permalink
  • nukers473
    11th Aug 2016 Member 0 Permalink


      

    Edited once by nukers473. Last: 11th Aug 2016