I’ve written a Verse code to go to the area I’m getting when I press the button, but it doesn’t work, I don’t know what’s wrong, so please tell me.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org/Simulation/Tags }
using { /Fortnite.com/Characters}
using { /Fortnite.com/FortPlayerUtilities }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/Teams }
respawn_manager := class(creative_device):
var CaptureWeightOfThisPoint1A:int = 0
var PlayerWeightOfThisPoint1A:float = 0.0
var WeightOfPoint1A:float = 0.0
var CaptureWeightOfThisPoint1B:int = 0
var PlayerWeightOfThisPoint1B:float = 0.0
var WeightOfPoint1B:float = 0.0
var CaptureWeightOfThisPoint1C:int = 0
var PlayerWeightOfThisPoint1C:float = 0.0
var WeightOfPoint1C:float = 0.0
var CaptureWeightOfThisPoint2A:int = 0
var PlayerWeightOfThisPoint2A:float = 0.0
var WeightOfPoint2A:float = 0.0
var CaptureWeightOfThisPoint2B:int = 0
var PlayerWeightOfThisPoint2B:float = 0.0
var WeightOfPoint2B:float = 0.0
var CaptureWeightOfThisPoint2C:int = 0
var PlayerWeightOfThisPoint2C:float = 0.0
var WeightOfPoint2C:float = 0.0
WeightForEachPlayer:float = 0.5
#@editable ButtonTeam1I : button_device = button_device{}
@editable ButtonTeam1A : button_device = button_device{}
@editable ButtonTeam1B : button_device = button_device{}
@editable ButtonTeam1C : button_device = button_device{}
@editable ButtonTeam2A : button_device = button_device{}
@editable ButtonTeam2B : button_device = button_device{}
@editable ButtonTeam2C : button_device = button_device{}
@editable CapturePoint1A : capture_area_device = capture_area_device{}
@editable CapturePoint1B : capture_area_device = capture_area_device{}
@editable CapturePoint1C : capture_area_device = capture_area_device{}
@editable CapturePoint2A : capture_area_device = capture_area_device{}
@editable CapturePoint2B : capture_area_device = capture_area_device{}
@editable CapturePoint2C : capture_area_device = capture_area_device{}
@editable LargeZone1A : player_counter_device =player_counter_device{}
@editable LargeZone1B : player_counter_device =player_counter_device{}
@editable LargeZone1C : player_counter_device =player_counter_device{}
@editable LargeZone2A : player_counter_device =player_counter_device{}
@editable LargeZone2B : player_counter_device =player_counter_device{}
@editable LargeZone2C : player_counter_device =player_counter_device{}
@editable Spawn : player_spawner_device = player_spawner_device{}
@editable Spawn2 : player_spawner_device = player_spawner_device{}
@editable Spawn3 : player_spawner_device = player_spawner_device{}
@editable Spawn4 : player_spawner_device = player_spawner_device{}
@editable Spawn5 : player_spawner_device = player_spawner_device{}
@editable Spawn6 : player_spawner_device = player_spawner_device{}
# If Team 1, we return 1. If Team 2, we return -1.
GetTeamDirectionOfAgent<private>(MyAgent:agent)<transacts>:int=
TeamCollectionRef:=GetPlayspace().GetTeamCollection()
if (FirstTeam := TeamCollectionRef.GetTeams()[0]):
if (TeamCollectionRef.IsOnTeam[MyAgent, FirstTeam]):
return 1
return -1
Capture1A(MyAgent:agent):void=
set CaptureWeightOfThisPoint1A = GetTeamDirectionOfAgent(MyAgent)
Capture1B(MyAgent:agent):void=
set CaptureWeightOfThisPoint1B = GetTeamDirectionOfAgent(MyAgent)
Capture1C(MyAgent:agent):void=
set CaptureWeightOfThisPoint1C = GetTeamDirectionOfAgent(MyAgent)
Capture2A(MyAgent:agent):void=
set CaptureWeightOfThisPoint2A = GetTeamDirectionOfAgent(MyAgent)
Capture2B(MyAgent:agent):void=
set CaptureWeightOfThisPoint2B = GetTeamDirectionOfAgent(MyAgent)
Capture2C(MyAgent:agent):void=
set CaptureWeightOfThisPoint2C = GetTeamDirectionOfAgent(MyAgent)
# Shift player weighting of point as players enter or leave
CountedZone1A(MyAgent:agent):void=
set PlayerWeightOfThisPoint1A = PlayerWeightOfThisPoint1A + (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
RemovedZone1A(MyAgent:agent):void=
set PlayerWeightOfThisPoint1A = PlayerWeightOfThisPoint1A - (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
CountedZone1B(MyAgent:agent):void=
set PlayerWeightOfThisPoint1B = PlayerWeightOfThisPoint1B + (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
RemovedZone1B(MyAgent:agent):void=
set PlayerWeightOfThisPoint1B = PlayerWeightOfThisPoint1B - (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
CountedZone1C(MyAgent:agent):void=
set PlayerWeightOfThisPoint1C = PlayerWeightOfThisPoint1C + (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
RemovedZone1C(MyAgent:agent):void=
set PlayerWeightOfThisPoint1C = PlayerWeightOfThisPoint1C - (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
CountedZone2A(MyAgent:agent):void=
set PlayerWeightOfThisPoint2A = PlayerWeightOfThisPoint2A + (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
RemovedZone2A(MyAgent:agent):void=
set PlayerWeightOfThisPoint2A = PlayerWeightOfThisPoint2A - (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
CountedZone2B(MyAgent:agent):void=
set PlayerWeightOfThisPoint2B = PlayerWeightOfThisPoint2B + (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
RemovedZone2B(MyAgent:agent):void=
set PlayerWeightOfThisPoint2B = PlayerWeightOfThisPoint2B - (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
CountedZone2C(MyAgent:agent):void=
set PlayerWeightOfThisPoint2C = PlayerWeightOfThisPoint2C + (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
RemovedZone2C(MyAgent:agent):void=
set PlayerWeightOfThisPoint2C = PlayerWeightOfThisPoint2C - (GetTeamDirectionOfAgent(MyAgent) * WeightForEachPlayer)
OnBegin<override>()<suspends>:void=
#ButtonTeam1I.InteractedWithEvent.Subscribe(ButtonInteractedHandler)
ButtonTeam1A.InteractedWithEvent.Subscribe(ButtonSpawn1A)
ButtonTeam1B.InteractedWithEvent.Subscribe(ButtonSpawn1B)
ButtonTeam1C.InteractedWithEvent.Subscribe(ButtonSpawn1C)
ButtonTeam2A.InteractedWithEvent.Subscribe(ButtonSpawn2A)
ButtonTeam2B.InteractedWithEvent.Subscribe(ButtonSpawn2B)
ButtonTeam2C.InteractedWithEvent.Subscribe(ButtonSpawn2C)
CapturePoint1A.ControlChangeEvent.Subscribe(Capture1A)
LargeZone1A.CountedEvent.Subscribe(CountedZone1A)
LargeZone1A.RemovedEvent.Subscribe(RemovedZone1A)
CapturePoint1B.ControlChangeEvent.Subscribe(Capture1B)
LargeZone1B.CountedEvent.Subscribe(CountedZone1B)
LargeZone1B.RemovedEvent.Subscribe(RemovedZone1B)
CapturePoint1C.ControlChangeEvent.Subscribe(Capture1C)
LargeZone1C.CountedEvent.Subscribe(CountedZone1C)
LargeZone1C.RemovedEvent.Subscribe(RemovedZone1C)
CapturePoint2A.ControlChangeEvent.Subscribe(Capture2A)
LargeZone2A.CountedEvent.Subscribe(CountedZone2A)
LargeZone2A.RemovedEvent.Subscribe(RemovedZone2A)
CapturePoint2B.ControlChangeEvent.Subscribe(Capture2B)
LargeZone2B.CountedEvent.Subscribe(CountedZone2B)
LargeZone2B.RemovedEvent.Subscribe(RemovedZone2B)
CapturePoint2C.ControlChangeEvent.Subscribe(Capture2C)
LargeZone2C.CountedEvent.Subscribe(CountedZone2C)
LargeZone2C.RemovedEvent.Subscribe(RemovedZone2C)
Spawn.Enable()
Spawn2.Enable()
Spawn3.Enable()
Spawn4.Enable()
Spawn5.Enable()
Spawn6.Enable()
#ButtonInteractedHandler(Agent:agent): void=
# if(FortCharacter := Agent.GetFortCharacter[]):
# FortCharacter.Damage(150.0)
# Agent.Respawn(vector3{X := 2570.0, Y := -6180.0, Z := 2690.0},IdentityRotation())
ButtonSpawn1A(Agent:agent): void=
set WeightOfPoint1A = PlayerWeightOfThisPoint1A + PlayerWeightOfThisPoint1A
if(WeightOfPoint1A > 0.0):
if(FortCharacter := Agent.GetFortCharacter[]):
FortCharacter.Damage(150.0)
Agent.Respawn(vector3{X := 11010.0, Y := -1533.0, Z := 3064.0},IdentityRotation())
ButtonSpawn1B(Agent:agent): void=
set WeightOfPoint1B = PlayerWeightOfThisPoint1B + PlayerWeightOfThisPoint1B
if(WeightOfPoint1B > 0.0):
if(FortCharacter := Agent.GetFortCharacter[]):
FortCharacter.Damage(150.0)
Agent.Respawn(vector3{X := 1923.5, Y := 1063.0, Z := 2680.0},IdentityRotation())
ButtonSpawn1C(Agent:agent): void=
set WeightOfPoint1C = PlayerWeightOfThisPoint1C + PlayerWeightOfThisPoint1C
if(WeightOfPoint1C > 0.0):
if(FortCharacter := Agent.GetFortCharacter[]):
FortCharacter.Damage(150.0)
Agent.Respawn(vector3{X := -6950.0, Y := 2848.0, Z := 2872.0},IdentityRotation())
ButtonSpawn2A(Agent:agent): void=
set WeightOfPoint2A = PlayerWeightOfThisPoint2A + PlayerWeightOfThisPoint2A
if(WeightOfPoint2A < 0.0):
if(FortCharacter := Agent.GetFortCharacter[]):
FortCharacter.Damage(150.0)
Agent.Respawn(vector3{X := 11010.0, Y := -1533.0, Z := 3064.0},IdentityRotation())
ButtonSpawn2B(Agent:agent): void=
set WeightOfPoint2B = PlayerWeightOfThisPoint2B + PlayerWeightOfThisPoint2B
if(WeightOfPoint2B < 0.0):
if(FortCharacter := Agent.GetFortCharacter[]):
FortCharacter.Damage(150.0)
Agent.Respawn(vector3{X := 1923.5, Y := 1063.0, Z := 2680.0},IdentityRotation())
ButtonSpawn2C(Agent:agent): void=
set WeightOfPoint2C = PlayerWeightOfThisPoint2C + PlayerWeightOfThisPoint2C
if(WeightOfPoint2C < 0.0):
if(FortCharacter := Agent.GetFortCharacter[]):
FortCharacter.Damage(150.0)
Agent.Respawn(vector3{X := -6950.0, Y := 2848.0, Z := 2872.0},IdentityRotation())