Advertisement
Carling

E2, CDE Health Meter Dupe Fix

Jul 30th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. @name Health Meter Fix
  2. @inputs Health MaxHealth
  3. @outputs Active Health MaxHealth
  4.  
  5. #[
  6.     Resolves the dupe issue with the CDE Health Meter
  7.     Simply the health meter, spawn this chip, and link
  8.     the chips outputs to what ever display you wish, dupe
  9.     and save.
  10. ]#
  11.  
  12. if (~Health || MaxHealth) {
  13.     Health = Health
  14.     MaxHealth = MaxHealth
  15. }
  16. elseif (clk("On")) {
  17.     Active = 1
  18. }
  19. elseif (first() || dupefinished()) {
  20.     foreach(I,E:entity=entity():getConstraints()) {
  21.         if (E:type() == "utility_health_meter") {
  22.             E:createWire(entity(),"Activate","Active")
  23.             entity():createWire(E,"Health","Health")
  24.             entity():createWire(E,"MaxHealth","Max Health")
  25.             break
  26.         }
  27.     }
  28.    
  29.     Active = 0
  30.     timer("On",1000)
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement