Cakey3101

Character Module - Episode 4 - Battlegrounds

Aug 30th, 2025
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.94 KB | Source Code | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2.  
  3. local Config = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("Config"))
  4.  
  5. local CharactersFolder = script:WaitForChild("Characters")
  6.  
  7. local CharacterModule = {}
  8.  
  9. function CharacterModule.GetCharacterInfo(Player: Player, Character: string)
  10.     local CharInfo = {
  11.         Name = nil,
  12.         Health = 0,
  13.         SpeedMult = 0,
  14.         Atk = {
  15.             Moves = 0,
  16.             Dmg = 0
  17.         },
  18.         Ult = {
  19.             Moves = 0,
  20.             PointsReq = 0,
  21.             Dmg = 0,
  22.             Duration = 0,
  23.             Moveset = {
  24.                 [Config.NormalKeyStrokes.One] = {
  25.                     AbilityName = "",
  26.                     Damage = 0,
  27.                     Cooldown = 0,
  28.                     HitboxType = "",
  29.                     Hitbox = Vector3.new(0, 0, 0),
  30.                    
  31.                     Keybind = Config.NormalKeyStrokes.One,
  32.                 },
  33.  
  34.                 [Config.NormalKeyStrokes.Two] = {
  35.                     AbilityName = "",
  36.                     Damage = 0,
  37.                     Cooldown = 0,
  38.                     HitboxType = "",
  39.                     Hitbox = Vector3.new(0, 0, 0),
  40.                    
  41.                     Keybind = Config.NormalKeyStrokes.Two,
  42.                 },
  43.  
  44.                 [Config.NormalKeyStrokes.Three] = {
  45.                     AbilityName = "",
  46.                     Damage = 0,
  47.                     Cooldown = 0,
  48.                     HitboxType = "",
  49.                     Hitbox = Vector3.new(0, 0, 0),
  50.                    
  51.                     Keybind = Config.NormalKeyStrokes.Three,
  52.                 },
  53.  
  54.                 [Config.NormalKeyStrokes.Four] = {
  55.                     AbilityName = "",
  56.                     Damage = 0,
  57.                     Cooldown = 0,
  58.                     HitboxType = "",
  59.                     Hitbox = Vector3.new(0, 0, 0),
  60.                    
  61.                     Keybind = Config.NormalKeyStrokes.Four,
  62.                 },
  63.             }
  64.         },
  65.         Moveset = {
  66.             [Config.NormalKeyStrokes.One] = {
  67.                 AbilityName = "",
  68.                 Damage = 0,
  69.                 Cooldown = 0,
  70.                 HitboxType = "",
  71.                 Hitbox = Vector3.new(0, 0, 0),
  72.                
  73.                 Keybind = Config.NormalKeyStrokes.One,
  74.             },
  75.  
  76.             [Config.NormalKeyStrokes.Two] = {
  77.                 AbilityName = "",
  78.                 Damage = 0,
  79.                 Cooldown = 0,
  80.                 HitboxType = "",
  81.                 Hitbox = Vector3.new(0, 0, 0),
  82.                
  83.                 Keybind = Config.NormalKeyStrokes.Two,
  84.             },
  85.  
  86.             [Config.NormalKeyStrokes.Three] = {
  87.                 AbilityName = "",
  88.                 Damage = 0,
  89.                 Cooldown = 0,
  90.                 HitboxType = "",
  91.                 Hitbox = Vector3.new(0, 0, 0),
  92.                
  93.                 Keybind = Config.NormalKeyStrokes.Three,
  94.             },
  95.  
  96.             [Config.NormalKeyStrokes.Four] = {
  97.                 AbilityName = "",
  98.                 Damage = 0,
  99.                 Cooldown = 0,
  100.                 HitboxType = "",
  101.                 Hitbox = Vector3.new(0, 0, 0),
  102.                
  103.                 Keybind = Config.NormalKeyStrokes.Four,
  104.             },
  105.  
  106.             [Config.NormalKeyStrokes.Ult] = {
  107.                 AbilityName = "",
  108.                 Damage = 0,
  109.                 Cooldown = 0,
  110.                 HitboxType = "",
  111.                 Hitbox = Vector3.new(0, 0, 0),
  112.                
  113.                 Keybind = Config.NormalKeyStrokes.Ult,
  114.             },
  115.         }
  116.     }
  117.  
  118.     local CharModule = require(CharactersFolder[Character])
  119.  
  120.     if CharModule then
  121.         local NormalMoves = CharModule.NormalMovesNum
  122.         local NormalAtkDmg = CharModule.NormalAtkDmg
  123.  
  124.         local UltMovesNum = CharModule.UltMovesNum
  125.         local UltPointsRequired = CharModule.UltPointsRequired
  126.         local UltAtkDamage = CharModule.UltAtkDamage
  127.         local UltDuration = CharModule.UltDuration
  128.  
  129.         local Moveset = CharModule.Moveset
  130.  
  131.         CharInfo.Name = CharModule.Name
  132.         CharInfo.Health = CharModule.Health
  133.         CharInfo.SpeedMult = CharModule.SpeedMult
  134.        
  135.         CharInfo.Atk.Moves = CharModule.NormalMovesNum
  136.         CharInfo.Atk.Dmg = CharModule.NormalAtkDmg
  137.         CharInfo.Ult.Moves = CharModule.UltMovesNum
  138.         CharInfo.Ult.PointsReq = CharModule.UltPointsRequired
  139.         CharInfo.Ult.Dmg = CharModule.UltAtkDamage
  140.         CharInfo.Ult.Duration = CharModule.UltDuration
  141.  
  142.         CharInfo.Moveset[Config.NormalKeyStrokes.One].AbilityName = CharModule.Moveset.One.Name
  143.         CharInfo.Moveset[Config.NormalKeyStrokes.One].Damage = CharModule.Moveset.One.Damage
  144.         CharInfo.Moveset[Config.NormalKeyStrokes.One].Cooldown = CharModule.Moveset.One.Cooldown
  145.         CharInfo.Moveset[Config.NormalKeyStrokes.One].HitboxType = CharModule.Moveset.One.HitboxType
  146.         CharInfo.Moveset[Config.NormalKeyStrokes.One].Hitbox = CharModule.Moveset.One.Hitbox
  147.        
  148.         CharInfo.Moveset[Config.NormalKeyStrokes.Two].AbilityName = CharModule.Moveset.Two.Name
  149.         CharInfo.Moveset[Config.NormalKeyStrokes.Two].Damage = CharModule.Moveset.Two.Damage
  150.         CharInfo.Moveset[Config.NormalKeyStrokes.Two].Cooldown = CharModule.Moveset.Two.Cooldown
  151.         CharInfo.Moveset[Config.NormalKeyStrokes.Two].HitboxType = CharModule.Moveset.Two.HitboxType
  152.         CharInfo.Moveset[Config.NormalKeyStrokes.Two].Hitbox = CharModule.Moveset.Two.Hitbox
  153.        
  154.         CharInfo.Moveset[Config.NormalKeyStrokes.Three].AbilityName = CharModule.Moveset.Three.Name
  155.         CharInfo.Moveset[Config.NormalKeyStrokes.Three].Damage = CharModule.Moveset.Three.Damage
  156.         CharInfo.Moveset[Config.NormalKeyStrokes.Three].Cooldown = CharModule.Moveset.Three.Cooldown
  157.         CharInfo.Moveset[Config.NormalKeyStrokes.Three].HitboxType = CharModule.Moveset.Three.HitboxType
  158.         CharInfo.Moveset[Config.NormalKeyStrokes.Three].Hitbox = CharModule.Moveset.Three.Hitbox
  159.        
  160.         CharInfo.Moveset[Config.NormalKeyStrokes.Four].AbilityName = CharModule.Moveset.Four.Name
  161.         CharInfo.Moveset[Config.NormalKeyStrokes.Four].Damage = CharModule.Moveset.Four.Damage
  162.         CharInfo.Moveset[Config.NormalKeyStrokes.Four].Cooldown = CharModule.Moveset.Four.Cooldown
  163.         CharInfo.Moveset[Config.NormalKeyStrokes.Four].HitboxType = CharModule.Moveset.Four.HitboxType
  164.         CharInfo.Moveset[Config.NormalKeyStrokes.Four].Hitbox = CharModule.Moveset.Four.Hitbox
  165.        
  166.         CharInfo.Moveset[Config.NormalKeyStrokes.Ult].AbilityName = CharModule.Moveset.Ult.Name
  167.         CharInfo.Moveset[Config.NormalKeyStrokes.Ult].Damage = CharModule.Moveset.Ult.Damage
  168.         CharInfo.Moveset[Config.NormalKeyStrokes.Ult].Cooldown = CharModule.Moveset.Ult.Cooldown
  169.         CharInfo.Moveset[Config.NormalKeyStrokes.Ult].HitboxType = CharModule.Moveset.Ult.HitboxType
  170.         CharInfo.Moveset[Config.NormalKeyStrokes.Ult].Hitbox = CharModule.Moveset.Ult.Hitbox
  171.        
  172.         -----------
  173.        
  174.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.One].AbilityName = CharModule.UltMoveset.One.Name
  175.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.One].Damage = CharModule.UltMoveset.One.Damage
  176.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.One].Cooldown = CharModule.UltMoveset.One.Cooldown
  177.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.One].HitboxType = CharModule.UltMoveset.One.HitboxType
  178.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.One].Hitbox = CharModule.UltMoveset.One.Hitbox
  179.  
  180.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Two].AbilityName = CharModule.UltMoveset.Two.Name
  181.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Two].Damage = CharModule.UltMoveset.Two.Damage
  182.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Two].Cooldown = CharModule.UltMoveset.Two.Cooldown
  183.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Two].HitboxType = CharModule.UltMoveset.Two.HitboxType
  184.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Two].Hitbox = CharModule.UltMoveset.Two.Hitbox
  185.  
  186.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Three].AbilityName = CharModule.UltMoveset.Three.Name
  187.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Three].Damage = CharModule.UltMoveset.Three.Damage
  188.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Three].Cooldown = CharModule.UltMoveset.Three.Cooldown
  189.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Three].HitboxType = CharModule.UltMoveset.Three.HitboxType
  190.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Three].Hitbox = CharModule.UltMoveset.Three.Hitbox
  191.  
  192.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Four].AbilityName = CharModule.UltMoveset.Four.Name
  193.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Four].Damage = CharModule.UltMoveset.Four.Damage
  194.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Four].Cooldown = CharModule.UltMoveset.Four.Cooldown
  195.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Four].HitboxType = CharModule.UltMoveset.Four.HitboxType
  196.         CharInfo.Ult.Moveset[Config.NormalKeyStrokes.Four].Hitbox = CharModule.UltMoveset.Four.Hitbox
  197.        
  198.         print(CharInfo)
  199.  
  200.         return CharInfo
  201.     end
  202.  
  203.     return {}
  204. end
  205.  
  206. function CharacterModule.GetCharacters(Player: Player)
  207.     local AvailableCharacters = {}
  208.  
  209.     for _, Character: Instance in CharactersFolder:GetChildren() do
  210.         if Character.Name == "Template" then continue end
  211.  
  212.         table.insert(AvailableCharacters, Character.Name)
  213.     end
  214.  
  215.     return (AvailableCharacters)
  216. end
  217.  
  218. return CharacterModule
Tags: robloxstudio
Advertisement
Add Comment
Please, Sign In to add comment