Advertisement
TPT_PL

Superfluid

Sep 14th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. local supfluid = elem.allocate("OUR", "HSFL")
  2.  
  3. elem.element(supfluid, elem.element(elem.DEFAULT_PT_SOAP))
  4. elem.property(supfluid, "Name", "HSFL")
  5. elem.property(supfluid, "Description", "Helium superfluid, extremely cold, strange behavior in containers.")
  6. elem.property(supfluid, "Color", 0xFF9900)
  7. elem.property(supfluid, "Weight", 100)
  8. elem.property(supfluid, "Temperature", 0)
  9.  
  10. local function wallClimb(i, x, y, s, nt)
  11.     local contained
  12.     r = sim.partID(math.random(x-1, x+1), y-1)
  13.     if r ~= nil then
  14.         rtype = sim.partProperty(r, "type")
  15.         contained = (bit.band(elem.property(rtype, "Properties"), elem.TYPE_PART) ~= 0) or (bit.band(elem.property(rtype, "Properties"), elem.TYPE_SOLID) ~= 0)
  16.     end
  17.     if contained then
  18.         sim.partProperty(i, "vy", -2)
  19.     end
  20. end
  21.  
  22. elem.property(supfluid, "Update", wallClimb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement