dunno then..
cool :D i made something like that before, but it only shuffles the colours. i've also shorten the code a bit
tpt.el.bran.menu=1
tpt.el.bran.enabled=1
tpt.el.bran.menusection=5
tpt.el.bran.name="NEON"
tpt.el.bran.description="Neon gas - glows in contact with electricity"
tpt.el.bran.color=0x00242424
tpt.el.bran.gravity=0
tpt.el.bran.diffusion=1
tpt.el.bran.advection=2
tpt.el.bran.properties=0x4828
tpt.el.bran.flammable=0
tpt.el.bran.heat=295
tpt.el.bran.weight=0
tpt.el.bran.airloss=1
local colour={0xFFAA0000,0xFFFF6600,0xFFFFFF00,0xFF00FF00,0xFF00FFFF,0xFF0000FF,0xFF9900CC}
local none=0x00242424
function neon(i,x,y,s,n)
if tpt.get_property("tmp",i)== 0 then
tpt.set_property("tmp",1,i)
end
if tpt.get_property("tmp2",i)== 1 then
tpt.set_property("life",150,i)
tpt.set_property("tmp2",0,i)
end
if tpt.parts[i].life<=0 then
tpt.set_property("dcolour",none,i)
end
end
function neonsprk(i,x,y,s,n)
local ntmp=tpt.get_property("tmp",tpt.el.bran.id)
type=tpt.get_property("ctype",x+math.random(-1,1),y+math.random(-1,1))
if tpt.get_property("ctype",i)==tpt.el.bran.id then
if tpt.get_property("tmp",i)==ntmp then
tpt.set_property("dcolour",colour[ntmp],i)
tpt.set_property("tmp2",1,i)
end
if tpt.get_property("tmp",i)==8 then
tpt.set_property("dcolour",colour[math.random(1,7)],i)
tpt.set_property("tmp2",1,i)
end
end
end
function neongraphics(i, colr, colg, colb)
return 1,0x00022110,30,30,30,30,30,30,30,30
end
tpt.graphics_func(neongraphics,tpt.el.bran.id)
tpt.element_func(neon,tpt.el.bran.id)
tpt.element_func(neonsprk,tpt.el.sprk.id)
okay, thanks for the advice
copy the code from the first post --> @mrsalit0s (View Post) into your text editor, save it as autorun.lua and put the file into your powder toy directory. you could also use cracker64's script manager https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=14596
but then you shouldn't save the file as autorun.lua. name it neon.lua then.
Why bran? Cuz when i change the 'bran' into something else, the element is not visible. PLZ answer. :(
Okay. thanks. :)
For function neon(i,x,y,s,n) it says I need "end" after that code and for if tpt.get_property("tmp",i)== 0 then I have to put "end" after that too. Then for local ntmp=tpt.get_property("tmp",tpt.el.bran.id)
type=tpt.get_property("ctype",x+math.random(-1,1),y+math.random(-1,1))
if tpt.get_property("ctype",i)==tpt.el.bran.id then It just gives me things says "Element does not exist" or "End expected near something" things. Why does it do that? I want to know why it refuses those lines of code from working.