Ball Lightning BLLT

  • aaswe2231
    14th Jan 2012 Member 0 Permalink
    its not appearing
  • billion57
    14th Jan 2012 Member 0 Permalink
    Epic Necro!
    Are you sure you are doing it right? Did you save it into an autorun.lua file?
  • Dawgie
    14th Jan 2012 Member 0 Permalink
    LOL i made it so instead of makeing plsm it makes thdr
  • Nab1929
    14th Jan 2012 Banned 0 Permalink
    This post is hidden because the user is banned
  • Dawgie
    14th Jan 2012 Member 0 Permalink
    hmmm doesn't work well with phot instead of plsm
    neither does ligh

  • Qweryuiop
    14th Apr 2012 Member 0 Permalink

    Doesn't explode

  • Minishooz
    14th Apr 2012 Member 0 Permalink
    @Qweryuiop (View Post)
    Necro much? >_>
  • Videogamer555
    27th Apr 2012 Member 0 Permalink
    There's something wrong with this script in the current version of TPT, namely IT DOESN'T WORK! And I made it, and spent hours making it, and not it doesn't work, and I'm MAD!!!!!!!!!!!!!!!!!
  • Plasmoid
    2nd May 2012 Member 0 Permalink
    I agree.
  • bubdan
    8th Feb 2013 Member 0 Permalink

    I got it to work.

     

    tpt.el.elec.menusection=5
    tpt.el.elec.color=0x9555ff
    tpt.el.elec.description="Ball Lightning. Travels in strait lines and bounces of solids. It electrifies conductors. Explodes when Life=1."
    tpt.el.elec.name="BLLT"
    math.randomseed(os.time())
    function ball_lightning(i,x,y,s,n)
    if tpt.get_property("tmp",i)==0 then
    tpt.set_property("life",math.random(50,150),i)
    tpt.set_property("tmp",1,i)
    end
    for n = 1,50 do
    xoff=math.random(-7,7)
    yoff=math.sqrt((49)-(xoff^2))
    if tpt.get_property("type",x+xoff,y+yoff)==0 then
    tpt.create(x+xoff,y+yoff,"ligh")
    tpt.set_property("life",4,x+xoff,y+yoff)
    tpt.set_property("tmp",math.atan2(-yoff,xoff)/3.14159*180,x+xoff,y+yoff)
    tpt.set_property("tmp2",1,x+xoff,y+yoff)
    end
    if tpt.get_property("type",x-xoff,y-yoff)==0 then
    tpt.create(x-xoff,y-yoff,"ligh")
    tpt.set_property("life",4,x-xoff,y-yoff)
    tpt.set_property("tmp",math.atan2(yoff,-xoff)/3.14159*180,x-xoff,y-yoff)
    tpt.set_property("tmp2",1,x-xoff,y-yoff)
    end
    end
    if tpt.get_property("life",i)==1 then
    for yoff=-38,38 do
    for xoff=-math.sqrt((38^2)-(yoff^2)),math.sqrt((38^2)-(yoff^2)) do
    if (x+xoff)>3 and (x+xoff)<608 and (y+yoff)>3 and (y+yoff)<380 then if tpt.get_property("type",x+xoff,y+yoff)==0 then
    tpt.create(x+xoff,y+yoff,"plsm")
    tpt.set_property("life",30,x+xoff,y+yoff)
    tpt.set_pressure((x+xoff)/4,(y+yoff)/4,1,1,10)
    end
    end
    end
    end
    tpt.delete(i)
    end
    end
    tpt.element_func(ball_lightning,tpt.el.elec.id,1)