Hi guys
I had made my first element thats Nitrogen(N2)
so here is the link to the code
click me to go to the link
I hope you like it! :)
Any bugs can be reported
tpt.parts[i].type = tpt.element('PHOT')
tpt.set_property("life", 900, i)
Thanks or the reply
now the probabilities are 1:1:1:1:1:6
--------------------
--Made By XXX70307--
--------------------
local nit = elements.allocate("MOD", "N2")
elements.element(elements.MOD_PT_N2, elements.element(tpt.element("HYGN")))
elements.property(elements.MOD_PT_N2, "Name", "N2")
elements.property(elements.MOD_PT_N2, "Description", "Nitrogen gas")
elements.property(elements.MOD_PT_N2, "MenuVisible", 1)
elements.property(elements.MOD_PT_N2, "MenuSection", 6)
elements.property(elements.MOD_PT_N2, "Advection", 2.0)
elements.property(elements.MOD_PT_N2, "AirDrag", 0)
elements.property(elements.MOD_PT_N2, "AirLoss", 0.99)
elements.property(elements.MOD_PT_N2, "Loss", 0.3)
elements.property(elements.MOD_PT_N2, "Collision", -0.10)
elements.property(elements.MOD_PT_N2, "Gravity", 0)
elements.property(elements.MOD_PT_N2, "Diffusion", 3)
elements.property(elements.MOD_PT_N2, "Falldown", 0)
elements.property(elements.MOD_PT_N2, "Flammable", 0)
elements.property(elements.MOD_PT_N2, "Explosive", 0)
elements.property(elements.MOD_PT_N2, "Meltable", 0)
elements.property(elements.MOD_PT_N2, "Hardness", 0)
elements.property(elements.MOD_PT_N2, "Weight", 1)
elements.property(elements.MOD_PT_N2, "HeatConduct", 100.0)
elements.property(elements.MOD_PT_N2, "State", ST_GAS)
elements.property(elements.MOD_PT_N2, "LowTemperature", 190.15)
elements.property(elements.MOD_PT_N2, "LowTemperatureTransition", tpt.element('LN2'))
local function nit(i, x, y, s, n)
local element = tpt.get_property("temp", x,y,i)
local rand =math.random(-1, 1)
if simulation.pressure(x/4,y/4)>=160 then
if element >= 9273.15 then
if math.random(1, 11) == 1 then
tpt.parts[i].type = tpt.element('PLSM')
end
if math.random(1, 11) == 2 then
tpt.parts[i].type = tpt.element('EXOT')
end
if math.random(1, 11) == 3 then
tpt.set_pressure(x+1, y+1)
end
if math.random(1, 11) == 4 then
tpt.parts[i].type = tpt.element('NEUT')
tpt.set_property("life", 900, i)
tpt.set_property("vx", rand, i)
tpt.set_property("vy", rand, i)
end
if math.random(1, 11) == 5 then
tpt.parts[i].type = tpt.element('PHOT')
tpt.set_property("life", 900, i)
tpt.set_property("vx", rand, i)
tpt.set_property("vy", rand, i)
end
if math.random(1, 11) >= 6 then
tpt.parts[i].type = tpt.element('OXYG')
end
end
end
end
tpt.element_func(nit, elements.MOD_PT_N2)
tpt.eltransition.ln2.tempHighValue = 190.16
tpt.eltransition.ln2.tempHighType = tpt.element('N2')
I tried as u said but is shows
"bad argument #1 to 'property' (number expected got nil)"
This is the correct code:-
local function nit(i, x, y, s, n)
local element = tpt.get_property("temp", x,y,i)
local rand =math.random(-1, 1)
if simulation.pressure(x/4,y/4)>=160 then
if element >= 9273.15 then
if math.random(1, 11) == 1 then
tpt.parts[i].type = tpt.element('PLSM')
elseif math.random(1, 11) == 2 then
tpt.parts[i].type = tpt.element('EXOT')
elseif math.random(1, 11) == 3 then
tpt.set_pressure(x+1, y+1)
elseif math.random(1, 11) == 4 then
tpt.parts[i].type = tpt.element('NEUT')
tpt.set_property("life", 900, i)
tpt.set_property("vx", rand, i)
tpt.set_property("vy", rand, i)
elseif math.random(1, 11) == 5 then
tpt.parts[i].type = tpt.element('PHOT')
tpt.set_property("life", 900, i)
tpt.set_property("vx", rand, i)
tpt.set_property("vy", rand, i)
else
tpt.parts[i].type = tpt.element('OXYG')
end
end
end
end
"elseif" is actually "else if".
I was wrong.
Actually i learnt lua from other moods like MrSalit0s
So can anyone help me in this post (View Post)
sorry, it was interfearence from another script.
NTRG shall be its name. And it does became a liquid underpressure. A banana dipped in liquid nitrogen can be used to hammer a nail in a block of wood.