Advertisement
Starly124

Untitled

Feb 23rd, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. --Water Mod
  2. TUNING.BUCKET = {}
  3. TUNING.BUCKET.WATER_BUCKET_USES = 10
  4.  
  5. local function CanFill(inst)
  6. if not inst.frozen then
  7. return true
  8. end
  9. return false
  10. end
  11.  
  12.  
  13. local function pondedit(inst)
  14. inst:AddComponent("filler")
  15. inst.components.filler:SetLiquid("water")
  16. inst.components.filler:SetFillTestFn(CanFill)
  17. inst.components.filler:SetMaxFills(90000000)
  18. end
  19.  
  20. local ACTIONS = GLOBAL.ACTIONS
  21. local Action = GLOBAL.Action
  22.  
  23. local FILL = Action()
  24. FILL.str = "Fill"
  25. FILL.id = "FILL"
  26. FILL.fn = function(act)
  27. if act.target and act.target.components.filler and act.invobject and act.invobject.components.fillable then
  28. return act.target.components.filler:Fill(act.invobject, act.doer)
  29. end
  30. end
  31.  
  32. AddAction(FILL)
  33.  
  34.  
  35. AddStategraphActionHandler("wilson", GLOBAL.ActionHandler(FILL, "dolongaction"))
  36.  
  37. AddPrefabPostInit("pond", pondedit, CanFill)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement