The following code is programmed to repair vehicles every second. The code works perfectly on GAME MODE ON (Editor) but when the map is published on Fortnite is not working at all. The code was working perfectly this weekend
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
RunHealther()
RunHealther()<suspends> : void =
loop:
block:
Sleep(1.0)
HealPlayersAndVehicles()
HealPlayersAndVehicles() : void =
AllPlayers:=GetPlayspace().GetPlayers()
for(Player : AllPlayers):
MaybeFortCharacter : ?fort_character = option{Player.GetFortCharacter[]}
if (ValidFortCharacter := MaybeFortCharacter?):
if(MyVehicle : fort_vehicle = ValidFortCharacter.GetVehicle[]):
if(MyVehicle.GetMaxHealth() > 7000.0):
MyVehicle.SetHealth(MyVehicle.GetHealth()+Tank_HealthPerSecond)
ValidFortCharacter.Heal(PickUp_PlayerHealthPerSecond)
if(MyVehicle.GetMaxHealth() > 3000.0):
MyVehicle.SetHealth(MyVehicle.GetHealth()+Bus_HealthPerSecond)
ValidFortCharacter.Heal(Bus_PlayerHealthPerSecond)
else:
MyVehicle.SetHealth(MyVehicle.GetHealth()+PickUp_HealthPerSecond)
ValidFortCharacter.Heal(Tank_PlayerHealthPerSecond)
If there is code not running on an “real” game, it is a completly mess create a complex UEFN map.