Advertisement
D_rawest16

ClickCombat

May 14th, 2021
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1. local module = {}
  2.  
  3. local GlobalMod = require(game.ReplicatedStorage.GlobalMod)
  4. local CombatMod = require(game.ReplicatedStorage.CombatMod)
  5. local rayCastMod = require(game.ReplicatedStorage.Modules.RaycastFromWeapon)
  6. local damageMod = require(game.ServerScriptService.Core.DamageModule)
  7.  
  8. local ChildrenMods = GlobalMod:GetChildrenMods(script)
  9. local debris = game:GetService("Debris")
  10. local List = {
  11.     [1] = {'Combo1Anim',2,0.32},
  12.     [2] = {'Combo2Anim',3,0.32},
  13.     [3] = {'Combo3Anim',4,0.32},
  14.     [4] = {'Combo4Anim',1,1.3}
  15. }
  16.  
  17. local tab = {}
  18. local Loaded = {}
  19. local ResetTab = {}
  20.  
  21.  
  22. function module:Attack(char,data)    
  23.    
  24.     if ResetTab[char] and os.clock() - ResetTab[char] > 1.3 or not tab[char] then
  25.         tab[char] = 1
  26.     end
  27.  
  28.     ResetTab[char] = os.clock()  
  29.    
  30.     CombatMod:AddedCharToATable(char,tab)
  31.     CombatMod:AddedCharToATable(char,ResetTab)
  32.    
  33.     rayCastMod:StartCasts(
  34.         {
  35.             Char = char,
  36.             IgnoreList = {workspace.Debris,char},
  37.             HowLong = 0.3,
  38.             ShowLine = false, -- use for debugging
  39.             DamageFunction = nil,
  40.             NumberOn = tab[char],
  41.             DamageModuleData = {
  42.                 Damage = data.BaseDamage,
  43.                 Sender = char,
  44.                 StunTime = tab[char] ~= 4 and 0.3 or 0.5,
  45.                 Fling = true,
  46.                 FlingHeight = tab[char] ~= 4 and 10 or 50,
  47.                 FlingDistance = tab[char] ~= 4 and 2 or 50,
  48.                 FlingDestroyTime = tab[char] ~= 4 and 0.3 or 0.5,
  49.                 EnemyShakeCamera = {10,5,0.05,0.05},
  50.                 SenderShakeCamera = {10,5,0.05,0.05},
  51.                 SenderBlur = {StopTime = 0.1,Amount = 10},
  52.                 EnemyBlur = {StopTime = 0.1,Amount = 10},
  53.                 StunAnimation = {'Combat','Stun1'},
  54.             },
  55.         }
  56.     )
  57.     _G:ChangeSpeed(char,1,0,0.33,true)
  58.  
  59.     CombatMod:PlayAnim(char,'Yoru',List[tab[char]][1],1,Enum.AnimationPriority.Action)
  60.    
  61.     CombatMod:updateCanAttack(char,List[tab[char]][3])
  62.     tab[char] = List[tab[char]][2]
  63.  
  64.  
  65. end
  66.  
  67. _G[script.Parent.Name..'ClickAttackReset'] = function(char)
  68.     tab[char] = 1
  69.     ResetTab[char] = os.clock()
  70. end
  71.  
  72.  
  73. return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement