Advertisement
Guest User

phosphorus by tpt_pl

a guest
Mar 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. -- phos is our element
  2.  
  3. function phosphorus(i, x, y, s, nt)
  4.     local glowtime = 100
  5.     local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
  6.     if r ~= nil then
  7.         if (sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE or sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM) and sim.partProperty(i, "tmp") == 0 then
  8.             sim.partProperty(i, "tmp", 1)
  9.             sim.partProperty(i, "life", glowtime)
  10.         elseif sim.partProperty(r, "type") == phos and sim.partProperty(r, "tmp") == 1 and sim.partProperty(i, "tmp") == 0 then
  11.             sim.partProperty(i, "tmp", 1)
  12.             sim.partProperty(i, "life", glowtime)
  13.         end
  14.     end
  15.     if sim.partProperty(i, "tmp") == 1 and sim.partProperty(i, "life") = 0 then
  16.         sim.partKill(i)
  17.         sim.partCreate(-1, x, y, elem.DEFAULT_PT_SMKE)
  18.         return 1
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement