Advertisement
ShiinaBR

Untitled

Jun 4th, 2023
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1.  
  2. using { /Fortnite.com/Devices }
  3. using { /Fortnite.com/Characters }
  4. using { /Fortnite.com/Game }
  5. using { /Verse.org/Simulation }
  6. using { /Verse.org/Simulation/Tags }
  7. using { /Verse.org/Random }
  8. using { /UnrealEngine.com/Temporary/Diagnostics }
  9.  
  10. # See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.
  11.  
  12. # A Verse-authored creative device that can be placed in a level
  13. gun_game_device := class(creative_device):
  14.  
  15. @editable
  16. UpgradeLevel_01 : int = 5 # SIDEWAYS SCYTHE UNLOCK AT LEVEL 100 / 5 for testing purposes
  17.  
  18. @editable
  19. UpgradeLevel_02 : int = 7 # KINETIC BLADE UNLOCK AT LEVEL 500 / 7 for testing purposes
  20.  
  21. @editable
  22. UpgradeLevel_03 : int = 10 # INFINITY BLADE UNLOCK AT LEVEL 1000 / 10 for testing purposes
  23.  
  24. var CurrentLevel : int = 1
  25.  
  26. MinLevel : int = 1
  27.  
  28. # Map container to track players progress. This is how to determine which weapon to award to the player
  29. var AgentMap : [agent]int = map{}
  30.  
  31. # Runs when the device is started in a running game
  32. OnBegin<override>()<suspends>:void=
  33.  
  34. # Get all the players in the experience
  35. AllPlayers := GetPlayspace().GetPlayers()
  36. for (GunGamePlayer : AllPlayers):
  37. if (FortCharacter := GunGamePlayer.GetFortCharacter[]):
  38. FortCharacter.EliminatedEvent().Subscribe(OnPlayerEliminated) # subscribe to eliminated event
  39.  
  40. # Add Players to a Map to track progress
  41. if (set AgentMap[GunGamePlayer] = 1) {}
  42.  
  43. # Event that handles when a player is getting an elimination
  44. OnPlayerEliminated(Result:elimination_result):void=
  45. Print("Player got a kill")
  46. EliminatingCharacter := Result.EliminatingCharacter
  47. if (FortCharacter := EliminatingCharacter?):
  48. if (EliminatingAgent := FortCharacter.GetAgent[]):
  49. #CurrentLevel : int = 1
  50. #CurrentLevelTest : int = CurrentLevel + 1;
  51. set CurrentLevel = CurrentLevel + 1
  52. Print("Player Level updated to {CurrentLevel}")
  53. if (CurrentLevel >= UpgradeLevel_01):
  54. Print("GIVING PLAYER SIDEWAYS SCYTHE")
  55. else if (CurrentLevel >= UpgradeLevel_02):
  56. Print("GIVING PLAYER KINETIC BLADE")
  57. else if (CurrentLevel >= UpgradeLevel_03):
  58. Print("GIVING PLAYER INFINITY BLADE")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement