I am trying to create a team manager that tracks the player respawn location and if it has been to long after it passed a certain checkpoint. But i don’t know how to create the player ref, i know there is a player type, but the spawner event returns me an agent type and i can’t convert it to the player. Event if it is the agent type i need, i can’t seem to get any available functions or variables to use from this agent.
using { /Fortnite.com/Devices }
using { /Verse.org/Native }
using { /Verse.org/Simulation }
team1_manager := class(creative_device):
@editable
Player1SpawnPad : player_spawner_device := player_spawner_device {}
@editable
Player2SpawnPad:player_spawner_device := player_spawner_device {}
# Getting a player reference
var PlayerScriptReference:?player = false
# Runs when this device_script is started in a running game
OnBegin<override>()<suspends>:void=
Player1SpawnPad.SpawnedEvent.Subscribe(HandlePlayerSpawned)
HandlePlayerSpawned(SpawnedPlayer:agent):void=
# Get the player reference
set PlayerScriptReference = option{SpawnedPlayer}
This is what i currently have.