Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[hook to "lib/managers/playermanager"
- you should to replace the names of the following:
- (line 25)
- "yuri_customperkdeck_register_listeners"
- ^ should be a better unique hook id of your choice
- (line 26)
- self:has_category_upgrade("player", "placeholder_health_regen_upgrade")
- ^ "player" should be the category of your upgrade; "placeholder_health_regen_upgrade" should be the same name of the upgrade id you made in upgradestweakdata.
- This upgrade should be a true/false value, which indicates whether or not the player has the ability to heal upon a headshot kill.
- (line 30)
- self:get_upgrade_value("player","yuri_health_regen_amount",0)
- ^ "player" should be the category of your upgrade; "placeholder_health_regen_upgrade" should be the same name of the upgrade id you made in upgradestweakdata.
- This upgrade should be a number value (inside a table), in case you want to make this amount upgradeable in later card tiers of your custom perk deck
- (lines 27 and 37)
- "activate_yuri_health_regen"
- ^ should be a unique "event id", or the name of what should happen when you get a headshot kill. don't worry too much about it, just make it unique like the hook id.
- --]]
- Hooks:PostHook(PlayerManager,"check_skills","yuri_customperkdeck_register_listeners",function(self)
- if self:has_category_upgrade("player", "placeholder_health_regen_upgrade") then
- self._message_system:register(Message.OnLethalHeadShot, "activate_yuri_health_regen", function()
- local player = self:local_player()
- if alive(player) then
- local restore_hp_amount = self:get_upgrade_value("player","yuri_health_regen_amount",0)
- if restore_hp_amount ~= 0 then
- player:character_damage():change_health(restore_hp_amount)
- end
- end
- end)
- else
- self._message_system:unregister(Message.OnLethalHeadShot, "activate_yuri_health_regen")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement