Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- if you want to do stuff global/ in differnet callacks.
- local Has ={
- SuperBum = false, -- variable which keeps track if you have Super Bum or not
- }
- function Mod:detectSuperBum(player)
- -- check if you have Super Bum
- if player:HasCollectible(CollectibleType.COLLECTIBLE_KEY_BUM)
- and player:HasCollectible(ColletibleType.COLLECTIBLE_DARK_BUM)
- and player:HasCollectible(CollectibleType.FOLLECTIBLE_BUM_FRIEND) then
- -- if yes set Has.SuperBum to true
- Has.SuperBum = true
- else
- -- if no set Has.SuperBum to false
- Has.SuperBum = false
- end
- if Has.SuperBum == true then -- if the player has Super Bum
- -- then we do stuff
- end
- end
- Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.detectSuperBum)
- -- if you wannt to keep things local
- function Mod:detectSuperBum(player)
- local HasSuperBum = false -- variable which keeps track if you have Super Bum
- -- check if you have Super Bum
- if player:HasCollectible(CollectibleType.COLLECTIBLE_KEY_BUM)
- and player:HasCollectible(ColletibleType.COLLECTIBLE_DARK_BUM)
- and player:HasCollectible(CollectibleType.FOLLECTIBLE_BUM_FRIEND) then
- -- if yes set HasSuperBum to true
- HasSuperBum = true
- end
- if HasSuperBum == true then -- if the player has Super Bum
- -- then we do stuff
- end
- end
- Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.detectSuperBum)
Advertisement
Add Comment
Please, Sign In to add comment