pedroff_1

Transformations+ API functional example

Mar 8th, 2020
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.15 KB | None | 0 0
  1. if _transformationsAPI.Transformations.OhCrap == nil then
  2.   _transformationsAPI.Transformations.OhCrap = {}
  3. end
  4. _transformationsAPI.Transformations.OhCrap.type = "normal"
  5. _transformationsAPI.Transformations.OhCrap.requirement = 3
  6. if not _transformationsAPI.Transformations.OhCrap.items then
  7.   _transformationsAPI.Transformations.OhCrap.items = {}
  8. end
  9. -- Adds the items and how much they increment the transformation counter by
  10. _transformationsAPI.Transformations.OhCrap.items.flush = {id=CollectibleType.COLLECTIBLE_FLUSH, increment = 1, type = "normal"}
  11. _transformationsAPI.Transformations.OhCrap.items.numberTwo = {id=CollectibleType.COLLECTIBLE_NUMBER_TWO, increment = 1, type = "normal"}
  12. _transformationsAPI.Transformations.OhCrap.items.eColi = {id=CollectibleType.COLLECTIBLE_E_COLI, increment = 1, type = "normal"}
  13. _transformationsAPI.Transformations.OhCrap.items.thePoop = {id=CollectibleType.COLLECTIBLE_POOP, increment = 1, type = "normal"}
  14. _transformationsAPI.Transformations.OhCrap.items.hallowedGround = {id=CollectibleType.COLLECTIBLE_HALLOWED_GROUND, increment = 1, type = "normal"}
  15. if not _transformationsAPI.Transformations.OhCrap.onActivationFunctions then
  16.   _transformationsAPI.Transformations.OhCrap.onActivationFunctions = {}
  17. end
  18. -- functions to be run when a player gets a transformation. Take as argument both
  19. function _transformationsAPI.Transformations.OhCrap.onActivationFunctions.causeRegularTransformation (player,count)
  20.   local activeitem = player:GetActiveItem()
  21.   local activecharge = player:GetActiveCharge()
  22.   local batterycharge = player:GetBatteryCharge()
  23.   -- gives all 3 items in quick succession, triggering the actual transformation
  24.   player:AddCollectible(CollectibleType.COLLECTIBLE_POOP,0,false)
  25.   player:RemoveCollectible(CollectibleType.COLLECTIBLE_POOP)
  26.   player:AddCollectible(CollectibleType.COLLECTIBLE_FLUSH,0,false)
  27.   player:RemoveCollectible(CollectibleType.COLLECTIBLE_FLUSH)
  28.   player:AddCollectible(CollectibleType.COLLECTIBLE_E_COLI,0,false)
  29.   player:RemoveCollectible(CollectibleType.COLLECTIBLE_E_COLI)
  30.   player:AddCollectible(activeitem,activecharge,false) -- gives the player back its original item
  31.  
  32.  
  33. end
Advertisement
Add Comment
Please, Sign In to add comment