Guys, in my map I want after some events to respawn some specific players (not randomly).
Is there something like that, for example to let this player have a unique register number and after he dies I respawn him regarding to some conditions?
Guys, in my map I want after some events to respawn some specific players (not randomly).
Is there something like that, for example to let this player have a unique register number and after he dies I respawn him regarding to some conditions?
You would have to identify that player somehow, i.e. they would have to perform an action you can capture so you can store the Agent
in a custom device.
You can then respawn that Agent
at a specific location.
using { /Fortnite.com/Devices }
using { /Fortnite.com/FortPlayerUtilities }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }
player_respawner_device := class(creative_device):
# For example, pressing a button will be the action that registers a player to be respawned
# If could be anything that callbacks with an Agent
@editable
Button:button_device = button_device {}
# The transform to respawn the player at
# Alternatively, you could reference an in-world prop/device and call GetTransform() on it
@editable
Target:transform = transform {}
var RegisteredPlayer:?player = false
OnBegin<override>()<suspends>:void=
Button.InteractedWithEvent.Subscribe(RegisterPlayer)
RegisterPlayer(Agent:agent):void=
if(Player := player[Agent]):
# Here we store the last player that interacted with the button
set RegisteredPlayer = option {Player}
# Call this in your code when you want the player to respawn, or register it as a callback for a specific action
RespawnRegisteredPlayer():void=
if(PlayerToRespawn := RegisteredPlayer?):
PlayerToRespawn.Respawn(Target.Translation, Target.Rotation)
I hope that’s what you were after?
Thank you man, ur a beast, although I’m ignorant in coding but from reading it I got the idea and that would be easy by forwarding this to an expert. Thanks
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.