instructions:
Save the code above into a text file named omni.lua
inside your Powder Toy data folder.
Open the in-game console and type:
dofile("omni.lua")
Look in the Solids menu For OMNI
THE CODE:
-- Allocate and register the custom element
local omni = elements.allocate("CUSTOM", "OMNI")
elements.element(omni, elements.element(elements.DEFAULT_PT_METL))
-- Visual and menu properties
elements.property(omni, "Name", "OMNI")
elements.property(omni, "Description", "Indestructible solid that conducts electricity, heat, and ARAY signals.")
elements.property(omni, "Colour", 0x00FFCC)
elements.property(omni, "MenuSection", elements.SC_SOLIDS)
elements.property(omni, "MenuVisible", 1)
-- Physics and Indestructibility properties
elements.property(omni, "Properties", elements.TYPE_SOLID + elements.PROP_CONDUCTS + elements.PROP_LIFE_DEC)
elements.property(omni, "Hardness", 0) -- Immune to acid and dissolution
elements.property(omni, "Weight", 100)
elements.property(omni, "HighPressure", elements.IPL) -- Immune to high pressure breaking
elements.property(omni, "LowPressure", elements.IPL)
elements.property(omni, "HighTemperature", elements.ITH) -- Immune to melting
elements.property(omni, "LowTemperature", elements.ITL)
-- Maximum Heat Conduction
elements.property(omni, "HeatConduct", 255)
-- Update function to handle ARAY signal propagation and maintain structural integrity
elements.property(omni, "Update", function(i, x, y, s, nt)
-- Conduct ARAY / WIFI signals (using ctype or life/tmp propagation)
local life = sim.partProperty(i, "life")
if life > 0 then
for rx = -1, 1 do
for ry = -1, 1 do
if rx ~= 0 or ry ~= 0 then
local r = sim.partID(x + rx, y + ry)
if r and sim.partProperty(r, "type") == omni then
if sim.partProperty(r, "life") == 0 then
sim.partProperty(r, "life", 4)
end
end
end
end
end
end
end)
i smell some ai here mostly beacuse of the odd comments, also idk how it works on pc but on android you do the whole file path like /storage/emulated/0/Android/data/uk.co.powdertoy.tpt/files/omni.lua instead of just omni.lua