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
MyDevice : cinematic_sequence_device = cinematic_sequence_device {}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
AllPlayers: []player = Self.GetPlayspace().GetPlayers()
if (FirstPlayer : player = AllPlayers[0]):
if (FortniteCharacter : fort_character = FirstPlayer.GetFortCharacter[]):
health:=FortniteCharacter.GetHealth()
maxhealth:=FortniteCharacter.GetMaxHealth()
loop:
Sleep(0.0)
if ( health=250.0):
MyDevice.Play()
break
I’m still working on It here is the new code It’s working now but got a new issue it’s only applying for one player I need to know how to fix that ):
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }
using { /Verse.org/Verse }
using { /Fortnite.com/Game }
hello_world_device := class(creative_device):
@editable
MyDevice : cinematic_sequence_device = cinematic_sequence_device {}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
AllPlayers: []player = Self.GetPlayspace().GetPlayers()
if (FirstPlayer : player = AllPlayers[0]):
Print("First step")
if (FortniteCharacter : fort_character = FirstPlayer.GetFortCharacter[]):
Print("2nd step")
maxhealth:=FortniteCharacter.GetMaxHealth()
loop:
Sleep(0.0)
Print("Checking health")
health:= FortniteCharacter.GetHealth()
if (health<250.0):
Print("Myuasfh")
MyDevice.Play()
break