Josh64

FireFighter

May 31st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. local Fire = RegisterMod("YourModName", 1)
  2. local game = Game() -- just for good practice
  3.  
  4. -- damage callback
  5.  
  6. function Fire:OnDamage(entity,amount,flag,source,countdown)
  7. -- If the player(entity) is your character
  8. if entity:GetName() == "CharacterName" then
  9. -- check for the source
  10. if source.Type == EntityType.ENTITY_FIREPLACE then -- it a fire
  11. return flase
  12. end
  13. if source.Type == EntityType.ENTITY_EFFECT
  14. and source.Variant == EffectVariant.BOMB_EXPLOSION then -- not sure if the fire mind explosion count as a bomb explosion
  15. if source.SpawnerType == EntityType.ENTITY_TEAR
  16. and source.SpawnerVariant == TearVariant.TEAR_FIRE_MIND then -- spawned by fire mind tear
  17. return false
  18. end
  19. end
  20. end
  21. end
  22.  
  23. Fire:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, Fire.OnDamage, EntityType.ENTITY_PLAYER)
Add Comment
Please, Sign In to add comment