Guest User

Untitled

a guest
Mar 24th, 2024
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1.  
  2. using { /Fortnite.com/Devices }
  3. using { /Verse.org/Simulation }
  4. using { /UnrealEngine.com/Temporary/Diagnostics }
  5. using { /Verse.org/Random}
  6. using { /Fortnite.com/Characters }
  7.  
  8. # See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.
  9.  
  10. # A Verse-authored creative device that can be placed in a level
  11. game_manager := class(creative_device):
  12.  
  13. @editable spawners:[]player_spawner_device = array{}
  14. @editable classes:[]class_and_team_selector_device = array{}
  15. @editable huds:[]hud_message_device = array{}
  16.  
  17. @editable islandSpawnDevice:player_spawner_device = player_spawner_device{}
  18. @editable islandSpawnClassSelector:class_and_team_selector_device = class_and_team_selector_device{}
  19.  
  20. @editable resetClassDevice:class_and_team_selector_device = class_and_team_selector_device{}
  21.  
  22. @editable items:[]item_granter_device = array{}
  23.  
  24. @editable remover:item_remover_device = item_remover_device{}
  25.  
  26. # Runs when the device is started in a running game
  27. OnBegin<override>()<suspends>:void=
  28.  
  29. islandSpawnDevice.SpawnedEvent.Subscribe(firstSpawn)
  30.  
  31. for (i := 0..spawners.Length):
  32. if(spawner:=spawners[i]):
  33. spawner.SpawnedEvent.Subscribe(randomClass)
  34.  
  35. randomClass(Player:agent):void=
  36. var power:int = 0 #GetRandomInt(0, classes.length)
  37.  
  38. if(classDevice := classes[0]):
  39. classDevice.ChangeClass(Player)
  40. if(hudDevice := huds[power]):
  41. hudDevice.Show(Player)
  42.  
  43. classStuff(Player, power)
  44.  
  45. firstSpawn(Player:agent):void=
  46. islandSpawnClassSelector.ChangeClass(Player)
  47.  
  48. resetClass(Player:agent):void=
  49. resetClassDevice.ChangeClass(Player)
  50.  
  51. classStuff(Player:agent, Class:int):void=
  52.  
  53. remover.Remove(Player)
  54.  
  55. if(Class = 0):
  56.  
  57. # Inventory #
  58. if(AR := items[0]):
  59. AR.GrantItem(Player)
  60. if(CowCatcher := items[3]):
  61. CowCatcher.GrantItem(Player)
  62. CowCatcher.GrantItem(Player)
  63. CowCatcher.GrantItem(Player)
  64. CowCatcher.GrantItem(Player)
  65. if(Falcon := items[4]):
  66. Falcon.GrantItem(Player)
  67. if(Nanites := items[7]):
  68. Nanites.GrantItem(Player)
  69. Nanites.GrantItem(Player)
  70. if(Shotgun := items[2]):
  71. Shotgun.GrantItem(Player)
  72. # Others #
  73. if(FortChar := Player.GetFortCharacter[]):
  74. FortChar.SetMaxHealth(300.0)
  75. FortChar.SetMaxShield(300.0)
  76. FortChar.SetHealth(300.0)
  77. FortChar.SetShield(300.0)
  78.  
Advertisement
Add Comment
Please, Sign In to add comment