Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using { /Fortnite.com/Devices }
- using { /Verse.org/Simulation }
- using { /UnrealEngine.com/Temporary/Diagnostics }
- using { /Verse.org/Random}
- using { /Fortnite.com/Characters }
- # See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.
- # A Verse-authored creative device that can be placed in a level
- game_manager := class(creative_device):
- @editable spawners:[]player_spawner_device = array{}
- @editable classes:[]class_and_team_selector_device = array{}
- @editable huds:[]hud_message_device = array{}
- @editable islandSpawnDevice:player_spawner_device = player_spawner_device{}
- @editable islandSpawnClassSelector:class_and_team_selector_device = class_and_team_selector_device{}
- @editable resetClassDevice:class_and_team_selector_device = class_and_team_selector_device{}
- @editable items:[]item_granter_device = array{}
- @editable remover:item_remover_device = item_remover_device{}
- # Runs when the device is started in a running game
- OnBegin<override>()<suspends>:void=
- islandSpawnDevice.SpawnedEvent.Subscribe(firstSpawn)
- for (i := 0..spawners.Length):
- if(spawner:=spawners[i]):
- spawner.SpawnedEvent.Subscribe(randomClass)
- randomClass(Player:agent):void=
- var power:int = 0 #GetRandomInt(0, classes.length)
- if(classDevice := classes[0]):
- classDevice.ChangeClass(Player)
- if(hudDevice := huds[power]):
- hudDevice.Show(Player)
- classStuff(Player, power)
- firstSpawn(Player:agent):void=
- islandSpawnClassSelector.ChangeClass(Player)
- resetClass(Player:agent):void=
- resetClassDevice.ChangeClass(Player)
- classStuff(Player:agent, Class:int):void=
- remover.Remove(Player)
- if(Class = 0):
- # Inventory #
- if(AR := items[0]):
- AR.GrantItem(Player)
- if(CowCatcher := items[3]):
- CowCatcher.GrantItem(Player)
- CowCatcher.GrantItem(Player)
- CowCatcher.GrantItem(Player)
- CowCatcher.GrantItem(Player)
- if(Falcon := items[4]):
- Falcon.GrantItem(Player)
- if(Nanites := items[7]):
- Nanites.GrantItem(Player)
- Nanites.GrantItem(Player)
- if(Shotgun := items[2]):
- Shotgun.GrantItem(Player)
- # Others #
- if(FortChar := Player.GetFortCharacter[]):
- FortChar.SetMaxHealth(300.0)
- FortChar.SetMaxShield(300.0)
- FortChar.SetHealth(300.0)
- FortChar.SetShield(300.0)
Advertisement
Add Comment
Please, Sign In to add comment