Josh64

Untitled

Oct 7th, 2022
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. local Mod = RegisterMod("Your mod name", 1); -- 'Mod' is a placeholder
  2. local game = Game()
  3.  
  4. -- your item
  5. -- register your item
  6. CollectibleType.COLLECTIBLE_YOUR_ITEM = Isaac.GetItemIdByName("Your item") -- must be the name you called it in the item.xml file
  7.  
  8. function Mod:onTearFire(tear)
  9.  
  10. local player = Isaac.GetPlayer(0) -- gets the player (must be modified for coop support)
  11.  
  12. player:HasCollectible(TrinketType.YOUR_ITEM) then -- if the player has your item
  13.  
  14. -- make sure it doesn't change other tear like things (may needs to be updated for Repentance)
  15. if not (tear.Variant == 4) -- its not Bob Rotten Head
  16. or not (tear.Variant == 9) then -- its not Chaos Card
  17.  
  18. tear.TearFlags = tear.TearFlags | TearFlags.TEAR_HOMING
  19. tear.TearFlags = tear.TearFlags | TearFlags.TEAR_SPECTRAL
  20. end
  21. end
  22. end
  23. Mod:AddCallback(ModCallbacks.MC_POST_FIRE_TEAR, Mod.onTearFire)
  24.  
Advertisement
Add Comment
Please, Sign In to add comment