tpt.el.elec.properties=0
tpt.el.elec.heat=9999
tpt.el.elec.airdrag=30
tpt.el.elec.menusection=3
tpt.el.elec.name="MTOR"
tpt.el.elec.description="Meteor. Heats nearby objects (the closer the stronger the heating), makes a shockwave, and explodes on impact. Use sparingly."
math.randomseed(os.time())
function mtor_update(i, x, y, s, n)
if tpt.get_property("tmp",i)==0 then
tpt.parts[i].tmp=1
randvel=math.random(-20,20)/10
tpt.parts[i].vx=randvel
tpt.parts[i].vy=math.sqrt(8-(randvel^2))
end
xvel=tpt.get_property("vx",i)/2
yvel=tpt.get_property("vy",i)/2
if yvel <= 0 or math.abs(xvel) > 1 then
tpt.delete(i)
end
xpos=x-xvel
ypos=y-yvel
elemtype=tpt.get_property("type",xpos,ypos)
if elemtype == 0 then
tpt.create(xpos,ypos,"bray")
tpt.set_property("temp",5000,xpos,ypos)
end
tpt.parts[i].temp=9999
elemtype25=tpt.get_property("type",x+xvel*5,y+yvel*5)
elemtype24=tpt.get_property("type",x+xvel*4,y+yvel*4)
elemtype23=tpt.get_property("type",x+xvel*3,y+yvel*3)
elemtype22=tpt.get_property("type",x+xvel*2,y+yvel*2)
elemtype21=tpt.get_property("type",x+xvel,y+yvel)
if elemtype25 ~= 0 and elemtype25 ~= tpt.el.elec.id and elemtype25 ~= tpt.el.bray.id and elemtype25 ~= tpt.el.dmnd.id and elemtype25 ~= tpt.el.void.id then
tpt.set_property("type","bomb",i)
tpt.set_property("life",0,i)
tpt.set_property("tmp",0,i)
elseif elemtype24 ~= 0 and elemtype24 ~= tpt.el.elec.id and elemtype24 ~= tpt.el.bray.id and elemtype24 ~= tpt.el.dmnd.id and elemtype24 ~= tpt.el.void.id then
tpt.set_property("type","bomb",i)
tpt.set_property("life",0,i)
tpt.set_property("tmp",0,i)
elseif elemtype23 ~= 0 and elemtype23 ~= tpt.el.elec.id and elemtype23 ~= tpt.el.bray.id and elemtype23 ~= tpt.el.dmnd.id and elemtype23 ~= tpt.el.void.id then
tpt.set_property("type","bomb",i)
tpt.set_property("life",0,i)
tpt.set_property("tmp",0,i)
elseif elemtype22 ~= 0 and elemtype22 ~= tpt.el.elec.id and elemtype22 ~= tpt.el.bray.id and elemtype22 ~= tpt.el.dmnd.id and elemtype22 ~= tpt.el.void.id then
tpt.set_property("type","bomb",i)
tpt.set_property("life",0,i)
tpt.set_property("tmp",0,i)
elseif elemtype21 ~= 0 and elemtype21 ~= tpt.el.elec.id and elemtype21 ~= tpt.el.bray.id and elemtype21 ~= tpt.el.dmnd.id and elemtype21 ~= tpt.el.void.id then
tpt.set_property("type","bomb",i)
tpt.set_property("life",0,i)
tpt.set_property("tmp",0,i)
end
for scany = -40,40 do
maxscanx=math.sqrt(1600-(scany^2))
for scanx = -maxscanx,maxscanx do
elemtype3 = tpt.get_property("type",x+scanx,y+scany)
if elemtype3 ~= 0 and elemtype3 ~= tpt.el.elec.id and elemtype3 ~= tpt.el.bray.id and elemtype3 ~= tpt.el.insl.id then
tpt.set_property("temp",tpt.get_property("temp",x+scanx,y+scany)+(19200/((scanx^2)+(scany^2))),x+scanx,y+scany)
end
end
end
end
tpt.element_func(mtor_update, tpt.el.elec.id,1)
@Videogamer555 (View Post)
how do I put it into the console?