Josh64

Option 2

Jan 4th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. local Dir = {
  2. [Direction.UP] = Vector(0,-1),
  3. [Direction.DOWN] = Vector(0,1),
  4. [Direction.LEFT] = Vector(-1,0),
  5. [Direction.RIGHT] = Vector(1,0)
  6. }
  7.  
  8. function ArunesMod:OnUpdate(player)
  9. local MoveDir = player:GetMovementDirection()
  10. for _, entities in pairs(Isaac.GetRoomEntities()) do
  11. if entities.Type == EntityType.ENTITY_EFFECT
  12. and entities.Variant == EffectVariant.YOUR_COSTUME_EFFECT then
  13. local costumeEffect = entities
  14. local sprite = costumeEffect:GetSprite()
  15. -- check the fire direction to set the offset
  16. if MoveDir == Direction.DOWN then
  17. if not (sprite;IsPlaying(“WalkDown“ then
  18. sprite:Play(“WalkDown“, true)
  19. end
  20. elseif MoveDir == Direction.RIGHT then
  21. if not (sprite;IsPlaying(“WalkRight“ then
  22. sprite:Play(“WalkRight“, true)
  23. end
  24. elseif MoveDir == Direction.UP then
  25. if not (sprite;IsPlaying(“WalkUp“ then
  26. sprite:Play(“WalkUp“, true)
  27. end
  28. elseif MoveDir == Direction.LEFT then
  29. if not (sprite;IsPlaying(“WalkLeft“ then
  30. sprite:Play(“WalkLeft“, true)
  31. end
  32. end
  33. end
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment