Here is a script that I have been working on. It uses a couple of other people's work, but I am a beginner at using Lua, and can anyone tell me if it works?:
local dorkybobster = elements.allocate("EXTR" , "EXPL")
elements.element(dorkybobster, elements.element(elements.DEFAULT_PT_SNOW))
elements.property(dorkybobster, "Name" , "EXPL")
elements.property(dorkybobster, "Description" , "Basic Explosive, possibly strong.")
elements.property(elements.dorkybobster_PT_EXPL, "Colour", 0x003486)
elements.property(elements.dorkybobster_PT_EXPL, "MenuVisible", 1)
elements.property(elements.dorkybobster_PT_EXPL, "MenuSection", elem.SC_EXPLOSIVE)
elements.property(elements.dorkybobster_PT_EXPL, "Gravity", 0.1000000001419012) --approximately the WATR value
elements.property(elements.dorkybobster_PT_EXPL, "Flammable", 1)
elements.property(elements.dorkybobster_PT_EXPL, "Explosive", 0.30)
elements.property(elements.dorkybobster_PT_EXPL, "Loss", 0.94999998807907) -- the same value as WATR
elements.property(elements.dorkybobster_PT_EXPL, "AirLoss", 0.98) -- approx water value
elements.property(elements.dorkybobster_PT_EXPL, "AirDrag", 0.009) -- approx watr value
elements.property(elements.dorkybobster_PT_EXPL, "Advection", 0.6) -- rounded watr value
elements.property(elements.dorkybobster_PT_EXPL, "Weight", 90)
elements.property(elements.dorkybobster_PT_EXPL, "Diffusion", 0) -- watr value
elements.property(elements.dorkybobster_PT_EXPL, "Falldown", 2) -- watr value
elements.property(elements.dorkybobster_PT_EXPL, "Name", "EXPL")
elements.property(elements.dorkybobster_PT_EXPL, "State", 2) -- watr value
elements.property(elements.dorkybobster_PT_EXPL, "Temperature", 250)
elements.property(elements.dorkybobster_PT_EXPL, "HighTemperature", 421.15)
elements.property(elements.dorkybobster_PT_EXPL, "HighTemperatureTransition", elements.dorkybobster_PT_NBLE)
elements.property(elements.dorkybobster_PT_EXPL, "LowTemperature", 210.15)
elements.property(elements.dorkybobster_PT_EXPL, "LowTemperatureTransition", elements.dorkybobster_PT_RBDM)
elements.property(elements.dorkybobster_PT_EXPL, "Hardness", 20)-- watr value
NU = function(i, x, y, s, n)
local clife = tpt.get_property('life', x, y)
local tempk = tpt.get_property('temp', x, y)
if clife > 1 then
for cx = -1, 1, 2 do
for cy = -1, 1, 2 do
if tpt.get_property('type', x+cx, y+cy) ~= EXPLOSIVE then
tpt.create(x + cx, y + cy, 'fire')
tpt.create(x + cx, y + cy, 'plsm')
tpt.create(x + cx, y + cy, 'smke')
end
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) == elem.DEFAULT_PT_SNOW or tpt.get_property('type',x + cx,y + cy) == elem.DEFAULT_PT_PLSM or tempk >= 800 then
tpt.set_property('life', 3500, x, y)
return true
end
end
end
end
if tempk < 210.15 then
tpt.set_property('type', 'RBDM', x, y)
end
if tempk > 543.15 and clife == 0 then
tpt.set_property('type', 'NBLE', x, y)
end
end
local dorkybobster = elements.allocate("EXTR" , "ITDR")
elements.allocate(dorkybobster, elements.element(elements_DEFAULT_THDR))
elements.property(dorkybobster, "Name" , "ITDR")
elements.property(dorkybobster, "Description" , "Improved Thunder. Lasts longer.")
end
local thdr_copy = elements.allocate("EXTR", "THDR")
elements.element(elements.dorkybobster_PT_THDR, elements.element(elements.DEFAULT_PT_THDR))
elements.property(elements.dorkybobster_PT_B, "Name", "ITDR")
elements.property(elements.dorkybobster_PT_B, "Description", "Improved Thunder.")
elements.property(elements.dorkybobster_PT_B, "Colour", 0xFFB9FEF7)
elements.property(elements.dorkybobster_PT_B, "MenuSection", 5)
elements.property(elements.dorkybobster_PT_B, "Gravity", 0)
elements.property(elements.dorkybobster_PT_B, "Flammable", 0)
elements.property(elements.dorkybobster_PT_B, "Explosive", 0)
elements.property(elements.dorkybobster_PT_B, "Loss", 0.15)
elements.property(elements.dorkybobster_PT_B, "AirLoss", 0.96)
elements.property(elements.dorkybobster_PT_B, "AirDrag", 0.03)
elements.property(elements.dorkybobster_PT_B, "Advection", 2)
elements.property(elements.dorkybobster_PT_B, "Weight", 32)
elements.property(elements.dorkybobster_PT_B, "Diffusion", 0)
elements.property(elements.dorkybobster_PT_B, "Falldown", 0)
ITDRUpdate = 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, 'thdr')
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', 300, x, y)
return true
end
end
end
end
end
tpt.element_func(ITDRUpdate, tpt.element('itdr'))
function growth(i,x,y,s,n)
type=tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
if type==tpt.el.thdr.id then
tpt.parts[i].type=tpt.el.hygn.id
end
end
tpt.element_func(growth,tpt.el.thdr.id)
Your script appears to have been cut off. You should use Pastebin for pasting code.
What does that mean? I am a beginner at using Lua and I started about 2 days ago...
I can't believe nobody said this. Can't you test it yourself? If you can't, I'll tell you how, I guess.
ayy lmao