Josh64

Has Super Bum

Oct 6th, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. -- if you want to do stuff global/ in differnet callacks.
  2. local Has ={
  3. SuperBum = false, -- variable which keeps track if you have Super Bum or not
  4. }
  5.  
  6. function Mod:detectSuperBum(player)
  7. -- check if you have Super Bum
  8. if player:HasCollectible(CollectibleType.COLLECTIBLE_KEY_BUM)
  9. and player:HasCollectible(ColletibleType.COLLECTIBLE_DARK_BUM)
  10. and player:HasCollectible(CollectibleType.FOLLECTIBLE_BUM_FRIEND) then
  11. -- if yes set Has.SuperBum to true
  12. Has.SuperBum = true
  13. else
  14. -- if no set Has.SuperBum to false
  15. Has.SuperBum = false
  16. end
  17. if Has.SuperBum == true then -- if the player has Super Bum
  18. -- then we do stuff
  19. end
  20. end
  21. Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.detectSuperBum)
  22.  
  23. -- if you wannt to keep things local
  24.  
  25. function Mod:detectSuperBum(player)
  26. local HasSuperBum = false -- variable which keeps track if you have Super Bum
  27.  
  28. -- check if you have Super Bum
  29. if player:HasCollectible(CollectibleType.COLLECTIBLE_KEY_BUM)
  30. and player:HasCollectible(ColletibleType.COLLECTIBLE_DARK_BUM)
  31. and player:HasCollectible(CollectibleType.FOLLECTIBLE_BUM_FRIEND) then
  32. -- if yes set HasSuperBum to true
  33. HasSuperBum = true
  34. end
  35. if HasSuperBum == true then -- if the player has Super Bum
  36. -- then we do stuff
  37. end
  38. end
  39. Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.detectSuperBum)
Advertisement
Add Comment
Please, Sign In to add comment