Advertisement
TPT_PL

For a Beaker

Oct 26th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.77 KB | None | 0 0
  1. local titanium = elem.allocate("CHEMICS", "TTNP")
  2. elem.element(titanium, elem.element(elem.DEFAULT_PT_TTAN))
  3. elem.property(titanium, "Name", "TTNP")
  4. elem.property(titanium, "Description", "Powdered titanium, so you can drop it into a test tube.")
  5. elem.property(titanium, "Gravity", 1)
  6. elem.property(titanium, "Falldown", 1)
  7. elem.property(titanium, "MenuSection", elem.SC_POWDERS)
  8. elem.property(titanium, "Properties", elem.TYPE_PART+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW+elem.PROP_LIFE_DEC)
  9.  
  10. local gold = elem.allocate("CHEMICS", "GLDP")
  11. elem.element(gold, elem.element(elem.DEFAULT_PT_GOLD))
  12. elem.property(gold, "Name", "GLDP")
  13. elem.property(gold, "Description", "Powdered gold, so you can drop it into a test tube.")
  14. elem.property(gold, "Gravity", 1)
  15. elem.property(gold, "Falldown", 1)
  16. elem.property(gold, "MenuSection", elem.SC_POWDERS)
  17. elem.property(gold, "Properties", elem.TYPE_PART+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW+elem.PROP_LIFE_DEC+elem.PROP_NEUTPASS)
  18.  
  19. local iron = elem.allocate("CHEMICS", "IRNP")
  20. elem.element(iron, elem.element(elem.DEFAULT_PT_IRON))
  21. elem.property(iron, "Name", "IRNP")
  22. elem.property(iron, "Description", "Powdered iron, so you can drop it into a test tube.")
  23. elem.property(iron, "Gravity", 1)
  24. elem.property(iron, "Falldown", 1)
  25. elem.property(iron, "MenuSection", elem.SC_POWDERS)
  26. elem.property(iron, "Properties", elem.TYPE_PART+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW+elem.PROP_LIFE_DEC)
  27.  
  28. local function goldUpdate(i, x, y, s, nt)
  29.     local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  30.     if r ~= nil then
  31.         if sim.partProperty(r, "type") == elem.DEFAULT_PT_BMTL and sim.partProperty(r, "tmp") == 1 then
  32.             sim.partChangeType(r, elem.DEFAULT_PT_IRON)
  33.         end
  34.     end
  35. end
  36.  
  37. local function ironUpdate(i, x, y, s, nt)
  38.     local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  39.     if r ~= nil then
  40.         local type = sim.partProperty(r, "type")
  41.         if type == elem.DEFAULT_PT_SALT or type == elem.DEFAULT_PT_WATR or type == elem.DEFAULT_PT_SLTW or type == elem.DEFAULT_PT_BUBW or type == elem.DEFAULT_PT_DSTW or type == elem.DEFAULT_PT_OXYG then
  42.             if math.random(1, 100) == 1 then
  43.                 sim.partChangeType(i, elem.DEFAULT_PT_BRMT)
  44.             end
  45.         end
  46.     end
  47. end
  48.  
  49. local function lavaUpdate(i, x, y, s, nt)
  50.     local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  51.     if r~= nil then
  52.         if sim.partProperty(r, "type") == elem.DEFAULT_PT_EXOT and (sim.partProperty(i, "ctype") == titanium or sim.partProperty(i, "ctype") == gold) then
  53.             sim.partProperty(i, "ctype", elem.DEFAULT_PT_VIBR)
  54.         end
  55.     end
  56. end
  57.  
  58. elem.property(gold, "Update", goldUpdate)
  59. elem.property(iron, "Update", ironUpdate)
  60. elem.property(elem.DEFAULT_PT_LAVA, "Update", lavaUpdate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement