Advertisement
Guest User

Still and Flowing water! (Tpt remade 1.0b concept)

a guest
Jul 15th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. local still = elements.allocate("TPT" , "STLW")
  2.  elements.element(still, elements.element(elements.DEFAULT_PT_WATR))
  3.  elements.property(still, "Name" , "STWTR")
  4.  elements.property(still, "Description" , "Still water.")
  5.  elements.property(still, "HighTemperature", 10001)
  6.  elements.property(elem.TPT_PT_STLW, "Update",
  7.  function(i,x,y,s,nt) --1
  8.   if math.sqrt(math.pow(sim.partProperty(i, "vx"),2)+math.pow(sim.partProperty(i, "vy"),2)) > 0.5 then --2
  9.    sim.partKill(i)
  10.    end --2
  11.   end --1
  12. ) --*1
  13.  
  14. local flow = elements.allocate("TPT" , "FWLW")
  15.  elements.element(flow, elements.element(elements.DEFAULT_PT_WATR))
  16.  elements.property(flow, "Name" , "FLWTR")
  17.  elements.property(flow, "Description" , "Flowing water.")
  18.  elements.property(flow, "HighTemperature", 10001)
  19.  elements.property(elem.TPT_PT_FWLW, "Update",
  20.  function(i,x,y,s,nt) --1
  21.   if math.random(1,2) == 1 then --2
  22.    if math.sqrt(math.pow(sim.partProperty(i, "vx"),2)+math.pow(sim.partProperty(i, "vy"),2)) < 0.1 then --3
  23.    sim.partKill(i)
  24.    end --3
  25.   end --2
  26.  end --1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement