I’m just experimenting with the features of GetHealth and I don’t know if this is the right way to get a player’s life or if it’s possible, but, the documentation about this doesn’t help me to know how to declare it correctly, how could I fix it?
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }
using { /Verse.org/Verse }
hello_world_device := class(creative_device):
@editable
boton:button_device=button_device{}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
boton.InteractedWithEvent.Subscribe(dano)
dano(Agent:agent) : void =
#heal
Health:=0.0
AllPlayers: []player = Self.GetPlayspace().GetPlayers()
if (FirstPlayer : player = AllPlayers[0]):
if (FortniteCharacter : fort_character = FirstPlayer.GetFortCharacter[]):
FortniteCharacter.GetHealth(health)
if( health=100):
Print("Max Health")
else:
FortniteCharacter.Heal(100.0)
Blockquote [{
“message”: “Unknown identifierhealth
.”
}]