Im creating a map with big bosses and im trying to have them regen health when they kill a player so the player has to come back with better items. im using a guard spawner. I have tried the health powerup but it doesnt seem to be working. Im creating my map on xbox creative
Hello Country_girl0615! I’m here to help you!
If your objective is to set the boss’ HP back to Max, the easiest way is to Despawn the enemies (not eliminating them) using their respective Guard Spawners function “Despawn” when the Player dies and Spawn them again immediately after that.
As there is no way add Health Regen to enemies in Fortnite Creative, this will ensure that you will face an enemy with Max HP every time you engange in battle with it.
I haven’t tried this, but looking at Fortnite.digest.verse it looks like you may be able to add health to the guard with Verse.
First, a guard is a fort_character, here’s an example of getting the fort_character for an agent.
OnBegin<override>()<suspends>:void =
if:
# Get the Agent (the NPC).
Agent := GetAgent[]
# Gets the Fortnite Character interface, which gets you access to its gameplay data
# including its AI module for navigation and focus.
Character := Agent.GetFortCharacter[]
Fortnite.digest.verse shows this for fort_character.
fort_character<native><public> := interface<unique><epic_internal>(positional, healable, healthful, damageable, shieldable, game_action_instigator, game_action_causer):
So, fort_character supports the healthful interface, and the healthful interface is defined as follows.
healthful<native><public> := interface<epic_internal>:
# Returns the health state of the object. This value will be between 0.0 and `GetMaxHealth`
GetHealth<public>()<transacts>:float
# Sets the health state of the object to `Health`.
# * Health state will be clamped between 1.0 and `GetMaxHealth`.
# * Health state cannot be directly set to 0.0. To eliminate `healthful` objects use the `damageable.Damage` functions instead.
SetHealth<public>(Health:float)<transacts>:void
# Returns the maximum health of the object. This value will be between 1.0 and Inf.
GetMaxHealth<public>()<transacts>:float
# Sets the maximum health state of the object.
# * MaxHealth will be clamped between 1.0 and Inf.
# * Current health state will be scaled up or down based on the scale difference between the old and new MaxHealth state.
SetMaxHealth<public>(MaxHealth:float)<transacts>:void
So, I think it’s worth trying - get the fort_character (shown as Character in the example above) and call Character.SetHealth(300.0) to see if it works.