Advertisement
cracker64

Untitled

Jul 31st, 2012
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. tpt.el.dmnd.name="OBSI"
  2. tpt.el.dmnd.description="Obsidian! (renamed dmnd)"
  3. tpt.el.dmnd.color=0X111124
  4. tpt.el.dmnd.hconduct = 0
  5. local LAVA = tpt.element("LAVA")
  6. local OBSI = tpt.element("OBSI")
  7.  
  8. function waterhook(i,x,y,s,n)
  9. --pick one random coord per frame to check, use the for loops for all
  10. local checkx = x+math.random(-1,1)
  11. local checky = y+math.random(-1,1)
  12. --for checkx = x-1,x+1 do
  13.     --for checky = y-1,y+1 do
  14.         local aroundtype = tpt.get_property("type",checkx,checky)
  15.         if aroundtype>0 and aroundtype==LAVA then
  16.             --local otherid = tpt.get_property("id",checkx,checky) --if you want to set some properties of the other element, not needed just for kill
  17.             tpt.set_property("type",OBSI,i)  --change self into something else, tpt.parts[i] is much much laggier than tpt.set_property()
  18.             tpt.delete(checkx,checky) --delete lava particle (the water eats it)
  19.             return true --means it died (skips movement later) more realistic
  20.         end
  21. --  end
  22. --end
  23. end
  24. tpt.element_func(waterhook,tpt.el.watr.id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement