I want a teleporter system that, after a countdown, can teleport any number of players to teleporters. Only one player should spawn per teleporter, which means we need an array that is randomly shuffled. After a player is teleported, the corresponding element should be removed. Unfortunately, I’m not yet good at Verse as I’m still learning it, and I was wondering if someone could help me with this because I need the teleporter system.
Insant Respawn after 6,5 seconds.txt (904 Bytes)
The code i have:
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices }
using { /Verse.org/Random }
random_teleporter := class(creative_device):
@editable
Teleporters: []teleporter_device = array{}
#Could be changed to pretty much anything tbh. As long as there is a listenable Agent.
@editable
EnterRandomTeleporter: mutator_zone_device = mutator_zone_device{}
OnBegin<override>()<suspends>:void=
EnterRandomTeleporter.AgentEntersEvent.Subscribe(EnterEvent)
EnterEvent(Agent:agent):void=
spawn:
EnterEvent2(Agent)
EnterEvent2(Agent:agent) <suspends> : void =
Sleep(6.5)
var RandomTeleporter:int = GetRandomInt(1, 16) # CHANGE THIS TO THE NUMBER OF TELEPORTERS
if(SelectedTeleporter := Teleporters[RandomTeleporter]):
SelectedTeleporter.Teleport(Agent)