Josh64

my attempt

Jan 28th, 2021
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1.  
  2. -- check if the player is flying and has the Bat Wing trinket (Bat Wings bug fix)
  3. if player:HasTrinket(TrinketType.TRINKET_BAT_WING) then
  4. if player.CanFly
  5. and costumeTr.BatWing == true then -- player has the trinket / trinket costumes get applied
  6. -- set the playerData
  7. if playerData.Ctc_HadFlight == nil
  8. or playerData.Ctc_HadFlight == false then -- in case this got already check once before
  9. playerData.Ctc_HadFlight = true
  10.  
  11. -- remove the Body 0 costumes
  12. player:TryRemoveNullCostume(Mod.COSTUME_CANCER) -- Cancer
  13. player:TryRemoveNullCostume(Mod.COSTUME_CANCER_ALT)
  14. player:TryRemoveNullCostume(Mod.COSTUME_MAGGYS_FAITH_MALT) -- Maggy's Faith for Maggy
  15. player:TryRemoveNullCostume(Mod.COSTUME_THE_LEFT_HAND) -- Left Hand
  16. player:TryRemoveNullCostume(Mod.COSTUME_RIB_OF_GREED) -- Rib of Greed
  17. player:TryRemoveNullCostume(Mod.COSTUME_LOCUST_OF_WAR_AFRAID) -- Locust of War
  18. player:TryRemoveNullCostume(Mod.COSTUME_LOCUST_OF_WAR)
  19. end
  20.  
  21. elseif player.CanFly == false -- only triggers if the player doesn't have flight,
  22. and playerData.Ctc_HadFlight == true -- but had flight once before
  23. and costumeTr.BatWing == true then -- and should have the small bat wings
  24.  
  25. -- resets the costumeTr so that the costumes can be reevalauted
  26. costumeTr.Cancer = false
  27. costumeTr.MaggysFaith = false
  28. costumeTr.TheLeftHand = false
  29. costumeTr.RibOfGreed = false
  30. costumeTr.LocustOfWar = false
  31.  
  32. -- reset for .Ctc_HadFlight the next use
  33. playerData.Ctc_HadFlight = false
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment