Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local clog = elem.allocate("FACTORY", "CLOG")
- elem.element(clog, elem.element(elem.DEFAULT_PT_WOOD))
- elem.property(clog, "Name", "CLOG")
- elem.property(clog, "Description", "Pipe clog. Can be cleaned with SOAP; uncleaned turns into STNE and eventually tears the pipe apart.")
- elem.property(clog, "Color", 0x400000)
- elem.property(clog, "Properties", elem.PROP_LIFE_DEC)
- local function clogUpdate(i, x, y, s, nt)
- if sim.partProperty(i, "tmp2") == 0 then
- sim.partProperty(i, "life", 201)
- sim.partProperty(i, "tmp2", 1)
- end;
- if sim.partProperty(i, "life") == 1 then
- if math.random(1, 25) == 1 then
- sim.partKill(i)
- sim.pressure(x/4, y/4, 6.00, 1, 1)
- else
- sim.partProperty(i, "type", elem.DEFAULT_PT_STNE)
- end
- end
- r = sim.partID(x+math.random(-1, 1), y+math.random(-1, 1))
- if r ~= nil then
- if sim.partProperty(r, "type") == elem.DEFAULT_PT_SOAP or sim.partProperty(r, "type") == elem.DEFAULT_PT_DSTW then
- sim.partKill(i)
- end
- end
- end
- elem.property(clog, "Update", clogUpdate)
- local function oilUpdate(i, x, y, s, nt)
- if math.random(1, 1000000000) == 1 then
- sim.partProperty(i, "type", clog)
- end
- end
- elem.property(elem.DEFAULT_PT_OIL, "Update", oilUpdate)
- local function deslUpdate(i, x, y, s, nt)
- if math.random(1, 2000000000) == 1 then
- sim.partProperty(i, "type", clog)
- end
- end
- elem.property(elem.DEFAULT_PT_DESL, "Update", deslUpdate)
- elem.property(elem.DEFAULT_PT_BRCK, "HighPressure", 5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement