Josh64

random trinket

Apr 18th, 2018
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. local Mod = RegisterMod("Mod", 1)
  2. local game = Game()
  3.  
  4. -- checks if the game started and adds one of the orignal 125 Trinkets to the player. Does not use the run seed.
  5.  
  6. function Mod:onPlayerInit(player)
  7. if game:GetFrameCount() == 1 then
  8. local player = Isaac.GetPlayer(0)
  9. local trinket = math.random(125)
  10. player:ToPlayer():AddTrinket(TrinketType.trinket)
  11. end
  12. end
  13. Mod:AddCallback(ModCallbacks.MC_POST_PLAYER_INIT, Mod.onPlayerInit)
Add Comment
Please, Sign In to add comment