Advertisement
ElliscecieCreates

ClientSource - Kali - SG2

Jun 12th, 2025
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 20.20 KB | Gaming | 0 0
  1. -- //user variables
  2. local player = game:GetService("Players").LocalPlayer
  3. local character = player.Character
  4. local humanoid = character:WaitForChild("Humanoid")
  5. local animator = humanoid:WaitForChild("Animator") or humanoid:WaitForChild("AnimationController")
  6. local sprintHoldingWeapon = character:WaitForChild("Sprint"):WaitForChild("HoldingWeapon")
  7. local playerGui = player:WaitForChild("PlayerGui")
  8. local humRoot = character:WaitForChild("HumanoidRootPart")
  9.  
  10. -- //services
  11. local userInput = game:GetService("UserInputService")
  12. local repStorage = game:GetService("ReplicatedStorage")
  13. local starterGui = game:GetService("StarterGui")
  14. local runService = game:GetService("RunService")
  15.  
  16. -- //service folders
  17. local animationsFolder = script.Parent:WaitForChild("Animations")
  18. local soundsFolder = script.Parent:WaitForChild("Sounds")
  19. local eventsFolder = script.Parent:WaitForChild("Events")
  20. local hapticsFolder = script.Parent:WaitForChild("Haptics")
  21. local valuesFolder = script.Parent:WaitForChild("Values")
  22.  
  23. -- //interface variables
  24. local combatCursorUI = playerGui:WaitForChild("BaseUI"):WaitForChild("CombatUI")
  25.  
  26. local specialStatusCursor = combatCursorUI:WaitForChild("SpecialStatusCursor")
  27. local mainAttackStatus = combatCursorUI:WaitForChild("MainAttack")
  28. local blockingStatus = combatCursorUI:WaitForChild("BlockingStatus")
  29. local heavyIconDecor = combatCursorUI:WaitForChild("HeavyIcon")
  30. local blockIconDecor = combatCursorUI:WaitForChild("BlockIcon")
  31. local specialIconDecor = combatCursorUI:WaitForChild("SpecialIcon")
  32. local heavyStatusCursor = combatCursorUI:WaitForChild("HeavyStatusCursor")
  33.  
  34. local blockPowerText = combatCursorUI:WaitForChild("BlockPower")
  35. local heavyRemainingCooldown = combatCursorUI:WaitForChild("HeavyRemainingCooldown")
  36. local specialRemainingCooldown = combatCursorUI:WaitForChild("SpecialRemainingCooldown")
  37.  
  38. -- //keyboard controls
  39. local defaultHeavyKeyboard = Enum.UserInputType.MouseButton2 -- MOUSE BUTTONS ONLY. TO CHANGE: // Enum.Keycode.{key}
  40. local defaultDodgeKeyboard = Enum.KeyCode.Q -- FOR DODGE CONTROL, YOU MUST ALSO CHANGE IN SPRINT SCRIPT: StarterPlayer\StarterCharacterScripts\Sprint
  41. local defaultSpecialKeyboard = Enum.KeyCode.R
  42. local defaultBlockKeyboard = Enum.KeyCode.F
  43. -- // //keyboard controls ui
  44. local keyboardControlsGroup = playerGui:WaitForChild("OtherButtons"):WaitForChild("KeyboardControls")
  45.  
  46. local uikbDash = keyboardControlsGroup:WaitForChild("Dash")
  47. local uikbcbDash = keyboardControlsGroup:WaitForChild("CombatDash")
  48. local uikbEmotes = keyboardControlsGroup:WaitForChild("Emotes")
  49. local uikbcbAttack = keyboardControlsGroup:WaitForChild("CombatAttack")
  50. local uikbcbSpecial = keyboardControlsGroup:WaitForChild("CombatSpecialAtt")
  51. local uikbcbBlock = keyboardControlsGroup:WaitForChild("CombatBlock")
  52. local uikbcbHeavy = keyboardControlsGroup:WaitForChild("CombatHeavyAtt")
  53. local uikbSprint = keyboardControlsGroup:WaitForChild("Sprint")
  54.  
  55. -- //gamepad controls
  56. local defaultHeavyGamepad = Enum.KeyCode.ButtonL2
  57. local defaultDodgeGamepad = Enum.KeyCode.ButtonL3 -- FOR DODGE CONTROL, YOU MUST ALSO CHANGE IN SPRINT SCRIPT: StarterPlayer\StarterCharacterScripts\Sprint
  58. local defaultSpecialGamepad = Enum.KeyCode.ButtonX
  59. local defaultBlockGamepad = Enum.KeyCode.ButtonB
  60. -- // //gamepad controls ui
  61. local gamepadControlsGroup = playerGui:WaitForChild("OtherButtons"):WaitForChild("GamepadControls")
  62.  
  63. local uigpDash = gamepadControlsGroup:WaitForChild("Dash")
  64. local uigpcbDash = gamepadControlsGroup:WaitForChild("CombatDash")
  65. local uigpEmotes = gamepadControlsGroup:WaitForChild("Emotes")
  66. local uigpcbAttack = gamepadControlsGroup:WaitForChild("CombatAttack")
  67. local uigpcbSpecial = gamepadControlsGroup:WaitForChild("CombatSpecialAtt")
  68. local uigpcbBlock = gamepadControlsGroup:WaitForChild("CombatBlock")
  69. local uigpcbHeavy = gamepadControlsGroup:WaitForChild("CombatHeavyAtt")
  70. local uigpSprint = gamepadControlsGroup:WaitForChild("Sprint")
  71.  
  72. -- //touch controls ui
  73. local touchControlsGroup = playerGui:WaitForChild("MobileButtons"):WaitForChild("MobileControls")
  74.  
  75. local uitmcbHeavy = touchControlsGroup:WaitForChild("AttackHeavy")
  76. local uitmcbSprint = touchControlsGroup:WaitForChild("Sprint")
  77. local uitmEmotes = touchControlsGroup:WaitForChild("Emotes")
  78. local uitmcbSpecial = touchControlsGroup:WaitForChild("AttackSpecial")
  79. local uitmcbBlock = touchControlsGroup:WaitForChild("Block")
  80.  
  81. -- //events
  82. local playerOpponentHit = eventsFolder:WaitForChild("PlayerOpponentHit")
  83. local playerBlockedAttack = eventsFolder:WaitForChild("PlayerBlockedAttack")
  84. local dialAttack = eventsFolder:WaitForChild("DialAttack")
  85. local dialAttackHeavy = eventsFolder:WaitForChild("DialHeavy")
  86. local dialAttackSpecial = eventsFolder:WaitForChild("DialSpecial")
  87. local beginBlocking = eventsFolder:WaitForChild("BeginBlocking")
  88. local endBlocking = eventsFolder:WaitForChild("EndBlocking")
  89. local dialDodge = eventsFolder:WaitForChild("DialDodge")
  90. local destroyBlockOpp = eventsFolder:WaitForChild("DestroyBlockOpp")
  91. local resetCombo = eventsFolder:WaitForChild("ResetCombo")
  92. local destroyBlockPlayer = eventsFolder:WaitForChild("DestroyBlockPlayer")
  93.  
  94. -- //haptics
  95. local blockIncomiongAttackHaptic = hapticsFolder:WaitForChild("BlockHit")
  96. local blockBrokenHaptic = hapticsFolder:WaitForChild("BlockBroken")
  97. local damagedOpponentHaptic = hapticsFolder:WaitForChild("DamagedOpponent")
  98. local equipDuoHaptic = hapticsFolder:WaitForChild("EquipDuo")
  99. local attackAttemptHaptic = hapticsFolder:WaitForChild("AttackAttempt")
  100. local heavyAttemptHaptic = hapticsFolder:WaitForChild("HeavyAttempt")
  101. local dodgeHaptic = hapticsFolder:WaitForChild("DodgeHaptic")
  102. local blockBrokenWarnHap = hapticsFolder:WaitForChild("BlockBrokenWarning")
  103.  
  104. -- //sounds
  105. local attackSound1 = soundsFolder:WaitForChild("Attack1")
  106. local attackSound2 = soundsFolder:WaitForChild("Attack2")
  107. local attackSound3 = soundsFolder:WaitForChild("Attack3")
  108. local attackSound4 = soundsFolder:WaitForChild("Attack4")
  109. local blockSound1 = soundsFolder:WaitForChild("Block1")
  110. local blockSound2 = soundsFolder:WaitForChild("Block2")
  111. local equipSound = soundsFolder:WaitForChild("Equip")
  112. local unequipSound = soundsFolder:WaitForChild("Unequip")
  113. local hitSound1 = soundsFolder:WaitForChild("Hit1")
  114. local hitSound2 = soundsFolder:WaitForChild("Hit2")
  115. local specialAttack = soundsFolder:WaitForChild("SpecialAttack")
  116. local specialHit = soundsFolder:WaitForChild("SpecialHit")
  117.  
  118. -- //anim presets
  119. local attackPreset1 = animationsFolder:WaitForChild("Attack1")
  120. local attackPreset2 = animationsFolder:WaitForChild("Attack2")
  121. local attackPreset3 = animationsFolder:WaitForChild("Attack3")
  122. local blockPreset = animationsFolder:WaitForChild("Block")
  123. local dodgePreset = animationsFolder:WaitForChild("DodgeDash")
  124. local equipPreset = animationsFolder:WaitForChild("EquipDuo")
  125. local heavyAttackPreset1 = animationsFolder:WaitForChild("HeavyAttack1")
  126. local heavyAttackPreset2 = animationsFolder:WaitForChild("HeavyAttack2")
  127. local idlePreset = animationsFolder:WaitForChild("Idle")
  128. local specialAttackPreset = animationsFolder:WaitForChild("SpecialAttack")
  129. local unequipPreset = animationsFolder:WaitForChild("UnequipDuo")
  130.  
  131. -- //animations
  132. local attackAnim = animator:LoadAnimation(attackPreset1)
  133. local attackAnim2 = animator:LoadAnimation(attackPreset2)
  134. local attackAnim3 = animator:LoadAnimation(attackPreset3)
  135. local blockAnim = animator:LoadAnimation(blockPreset)
  136. --local dodgeAnim = animator:LoadAnimation(dodgePreset)
  137. local equipAnim = animator:LoadAnimation(equipPreset)
  138. local heavyAttackAnim1 = animator:LoadAnimation(heavyAttackPreset1)
  139. local heavyAttackAnim2 = animator:LoadAnimation(heavyAttackPreset2)
  140. local idleAnim = animator:LoadAnimation(idlePreset)
  141. local specialAttackAnim = animator:LoadAnimation(specialAttackPreset)
  142. local unequipAnim = animator:LoadAnimation(unequipPreset)
  143.  
  144. specialAttackAnim.Priority = Enum.AnimationPriority.Action4
  145.  
  146. -- //values and variables
  147. -- // //cooldown variables
  148. local attackCooldown = valuesFolder:WaitForChild("AttackCooldown")
  149. local heavyCooldown = valuesFolder:WaitForChild("HeavyCooldown")
  150. local specialCooldown = valuesFolder:WaitForChild("SpecialCooldown")
  151. local blockCooldown = valuesFolder:WaitForChild("BlockCooldown")
  152. local blockBrokenShield = valuesFolder:WaitForChild("BlockBrokenCooldown")
  153. local dodgeSyncCooldown = valuesFolder:WaitForChild("DodgeDashCooldown")
  154. local blockPower = valuesFolder:WaitForChild("BlockPower")
  155. local maxBlockPower = valuesFolder:WaitForChild("MaxBlockPower")
  156.  
  157. -- // //attack variables
  158. local canAttack = true
  159. local canDodge = true
  160. local canDuck = true
  161. local canSpecial = true
  162. local canBlock = true
  163.  
  164. -- // //defense variables
  165. local isBlocking = false
  166. local isDodging = false
  167. local isAttacking = false
  168. local toolEquipped = false
  169.  
  170. -- // LOCAL SCRIPT START
  171.  
  172. blockPowerText.Text = tostring(blockPower.Value).."/"..tostring(maxBlockPower.Value)
  173. blockPowerText.TextStrokeColor3 = Color3.new(0.5, 1, 0.5)
  174.  
  175. -- Fix character-related variable refresh on respawn
  176.  
  177. local function setupCharacterReferences()
  178.     character = player.Character or player.CharacterAdded:Wait()
  179.     humanoid = character:WaitForChild("Humanoid")
  180.     animator = humanoid:FindFirstChildOfClass("Animator") or humanoid:FindFirstChild("AnimationController")
  181.     humRoot = character:WaitForChild("HumanoidRootPart")
  182.     sprintHoldingWeapon = character:WaitForChild("Sprint"):WaitForChild("HoldingWeapon")
  183. end
  184.  
  185. -- Initial setup
  186. setupCharacterReferences()
  187.  
  188. -- Refresh on respawn
  189. player.CharacterAdded:Connect(function()
  190.     setupCharacterReferences()
  191. end)
  192.  
  193. local currentAttack = 1
  194. script.Parent.Activated:Connect(function()
  195.     if canAttack and not isBlocking and not isDodging then
  196.         canAttack = false
  197.         dialAttack:FireServer()
  198.         combatCursorUI:WaitForChild("MainAttack").Image = "rbxassetid://102064020768208"
  199.         if currentAttack == 1 then
  200.             attackAnim:Play()
  201.             attackSound1:Play()
  202.             currentAttack = 2
  203.         elseif currentAttack == 2 then
  204.             attackAnim2:Play()
  205.             attackSound2:Play()
  206.             currentAttack = 3
  207.         elseif currentAttack == 3 then
  208.             attackAnim3:Play()
  209.             attackSound3:Play()
  210.             currentAttack = 1
  211.         end
  212.         attackAttemptHaptic:Play()
  213.         task.wait(attackCooldown.Value)
  214.         canAttack = true
  215.         combatCursorUI:WaitForChild("MainAttack").Image = "rbxassetid://140610886134688"
  216.     else
  217.         return false;
  218.     end
  219. end)
  220. script.Parent.Equipped:Connect(function()
  221.     combatCursorUI.Visible = true
  222.    
  223.     specialIconDecor.ImageColor3 = Color3.new(1, 1, 1)
  224.     specialIconDecor.ImageTransparency = 0
  225.     specialRemainingCooldown.TextTransparency = 0.75
  226.     specialRemainingCooldown.TextStrokeColor3 = Color3.new(0.5, 1, 0.5)
  227.    
  228.     heavyIconDecor.ImageColor3 = Color3.new(1, 1, 1)
  229.     heavyRemainingCooldown.TextTransparency = 0.75
  230.     heavyRemainingCooldown.TextStrokeColor3 = Color3.new(0.5, 1, 0.5)
  231.     heavyIconDecor.ImageTransparency = 0
  232.    
  233.     equipDuoHaptic:Play()
  234.    
  235.     toolEquipped = true
  236.     equipSound:Play()
  237.     equipAnim:Play()
  238.     idleAnim:Play()
  239.     sprintHoldingWeapon.Value = true
  240.    
  241.     sprintHoldingWeapon.Parent:WaitForChild("SGearDashCooldown").Value = dodgeSyncCooldown.Value
  242.    
  243.     uikbDash.Visible = false
  244.     uikbcbDash.Visible = true
  245.     uikbEmotes.Visible = false
  246.     uikbcbAttack.Visible = true
  247.     uikbcbSpecial.Visible = true
  248.     uikbcbBlock.Visible = true
  249.     uikbcbHeavy.Visible = true
  250.     uikbSprint.Visible = false
  251.    
  252.     uigpDash.Visible = false
  253.     uigpcbDash.Visible = true
  254.     uigpEmotes.Visible = false
  255.     uigpcbAttack.Visible = true
  256.     uigpcbSpecial.Visible = true
  257.     uigpcbBlock.Visible = true
  258.     uigpcbHeavy.Visible = true
  259.     uigpSprint.Visible = false
  260.    
  261.     uitmcbHeavy.Visible = true
  262.     uitmcbSprint.Image = "rbxassetid://83841678364163"
  263.     uitmEmotes.Visible = false
  264.     uitmcbSpecial.Visible = true
  265.     uitmcbBlock.Visible = true
  266. end)
  267. script.Parent.Unequipped:Connect(function()
  268.     combatCursorUI.Visible = false
  269.    
  270.     equipDuoHaptic:Play()
  271.    
  272.     unequipSound:Play()
  273.     idleAnim:Stop()
  274.     unequipAnim:Play()
  275.     endBlocking:FireServer()
  276.     toolEquipped = false
  277.     sprintHoldingWeapon.Value = false
  278.    
  279.     sprintHoldingWeapon.Parent:WaitForChild("SGearDashCooldown").Value = 0
  280.    
  281.     uikbDash.Visible = true
  282.     uikbcbDash.Visible = false
  283.     uikbEmotes.Visible = true
  284.     uikbcbAttack.Visible = false
  285.     uikbcbSpecial.Visible = false
  286.     uikbcbBlock.Visible = false
  287.     uikbcbHeavy.Visible = false
  288.     uikbSprint.Visible = true
  289.    
  290.     uigpDash.Visible = true
  291.     uigpcbDash.Visible = false
  292.     uigpEmotes.Visible = true
  293.     uigpcbAttack.Visible = false
  294.     uigpcbSpecial.Visible = false
  295.     uigpcbBlock.Visible = false
  296.     uigpcbHeavy.Visible = false
  297.     uigpSprint.Visible = true
  298.    
  299.     uitmcbHeavy.Visible = false
  300.     uitmcbSprint.Image = "rbxassetid://73337704931687"
  301.     uitmEmotes.Visible = true
  302.     uitmcbSpecial.Visible = false
  303.     uitmcbBlock.Visible = false
  304. end)
  305. humanoid.Died:Connect(function()
  306.     combatCursorUI.Visible = false
  307.  
  308.     equipDuoHaptic:Play()
  309.  
  310.     unequipSound:Play()
  311.     idleAnim:Stop()
  312.     unequipAnim:Play()
  313.     endBlocking:FireServer()
  314.     toolEquipped = false
  315.     sprintHoldingWeapon.Value = false
  316.  
  317.     sprintHoldingWeapon.Parent:WaitForChild("SGearDashCooldown").Value = 0
  318.  
  319.     uikbDash.Visible = true
  320.     uikbcbDash.Visible = false
  321.     uikbEmotes.Visible = true
  322.     uikbcbAttack.Visible = false
  323.     uikbcbSpecial.Visible = false
  324.     uikbcbBlock.Visible = false
  325.     uikbcbHeavy.Visible = false
  326.     uikbSprint.Visible = true
  327.  
  328.     uigpDash.Visible = true
  329.     uigpcbDash.Visible = false
  330.     uigpEmotes.Visible = true
  331.     uigpcbAttack.Visible = false
  332.     uigpcbSpecial.Visible = false
  333.     uigpcbBlock.Visible = false
  334.     uigpcbHeavy.Visible = false
  335.     uigpSprint.Visible = true
  336.  
  337.     uitmcbHeavy.Visible = false
  338.     uitmcbSprint.Image = "rbxassetid://73337704931687"
  339.     uitmEmotes.Visible = true
  340.     uitmcbSpecial.Visible = false
  341.     uitmcbBlock.Visible = false
  342. end)
  343.  
  344. function blockFunction() --block
  345.     if canBlock then
  346.         equipDuoHaptic:Play()
  347.         blockAnim:Play()
  348.         beginBlocking:FireServer()
  349.         isBlocking = true
  350.         canBlock = false
  351.     else
  352.         return false;
  353.     end
  354. end
  355. function updateCooldownLabel(label, duration)
  356.     task.spawn(function()
  357.         for t = duration, 0, -0.1 do
  358.             label.Text = string.format("%.1f", t)
  359.             task.wait(0.1)
  360.         end
  361.         label.Text = "0.0" -- Clear text when done
  362.     end)
  363. end
  364. function specialAttack() --special
  365.     if canSpecial and not isDodging and not isBlocking then
  366.         attackAttemptHaptic:Play()
  367.         specialAttackAnim:Play()
  368.         dialAttackSpecial:FireServer()
  369.         destroyBlockOpp:FireServer()
  370.  
  371.         specialStatusCursor.Image = "rbxassetid://108427809871145"
  372.         specialIconDecor.ImageColor3 = Color3.new(1, 0.5, 0.5)
  373.         specialIconDecor.ImageTransparency = 0.5
  374.         specialRemainingCooldown.Text = string.format("%.1f", specialCooldown.Value)
  375.         specialRemainingCooldown.TextTransparency = 0
  376.         specialRemainingCooldown.TextStrokeColor3 = Color3.new(1, 0.5, 0.5)
  377.         updateCooldownLabel(specialRemainingCooldown, specialCooldown.Value)
  378.  
  379.         canSpecial = false
  380.         task.wait(specialCooldown.Value)
  381.         specialIconDecor.ImageColor3 = Color3.new(1, 1, 1)
  382.         specialIconDecor.ImageTransparency = 0
  383.         specialRemainingCooldown.TextTransparency = 0.75
  384.         specialRemainingCooldown.TextStrokeColor3 = Color3.new(0.5, 1, 0.5)
  385.         specialStatusCursor.Image = "rbxassetid://81084853793787"
  386.         specialRemainingCooldown.Text = "0.0"
  387.         canSpecial = true
  388.     else
  389.         return false;
  390.     end
  391. end
  392. local currentHeavyAttack = 1
  393. function heavyAttack()
  394.     if canAttack and not isDodging and not isBlocking then
  395.         canAttack = false
  396.         heavyAttemptHaptic:Play()
  397.         humanoid.WalkSpeed = 0
  398.         sprintHoldingWeapon.Parent:WaitForChild("HeavyAttacking").Value = true
  399.         dialAttackHeavy:FireServer()
  400.         uitmcbHeavy.Visible = false
  401.  
  402.         heavyStatusCursor.Image = "rbxassetid://82548695337954"
  403.         heavyRemainingCooldown.TextTransparency = 0
  404.         heavyRemainingCooldown.TextStrokeColor3 = Color3.new(1, 0.5, 0.5)
  405.         heavyIconDecor.ImageColor3 = Color3.new(1, 0.5, 0.5)
  406.         heavyIconDecor.ImageTransparency = 0.5
  407.         heavyRemainingCooldown.Text = string.format("%.1f", heavyCooldown.Value)
  408.         updateCooldownLabel(heavyRemainingCooldown, heavyCooldown.Value)
  409.  
  410.         if currentHeavyAttack == 1 then
  411.             heavyAttackAnim1:Play()
  412.             currentHeavyAttack = 2
  413.         else
  414.             heavyAttackAnim2:Play()
  415.             currentHeavyAttack = 1
  416.         end
  417.  
  418.         task.wait(heavyCooldown.Value)
  419.  
  420.         heavyStatusCursor.Image = "rbxassetid://106358082339213"
  421.         heavyIconDecor.ImageColor3 = Color3.new(1, 1, 1)
  422.         heavyRemainingCooldown.TextTransparency = 0.75
  423.         heavyRemainingCooldown.TextStrokeColor3 = Color3.new(0.5, 1, 0.5)
  424.         heavyIconDecor.ImageTransparency = 0
  425.         heavyRemainingCooldown.Text = "0.0"
  426.         uitmcbHeavy.Visible = true
  427.         humanoid.WalkSpeed = 6
  428.         canAttack = true
  429.         sprintHoldingWeapon.Parent:WaitForChild("HeavyAttacking").Value = false
  430.     else
  431.         script.Parent:Activate()
  432.     end
  433. end
  434. function dodgeRequest()
  435.     if canDodge then
  436.         canDodge = false
  437.         dialDodge:FireServer()
  438.         dodgeHaptic:Play()
  439.         task.wait(dodgeSyncCooldown.Value)
  440.     else
  441.         return false;
  442.     end
  443. end
  444. function endBlockFunction() --block
  445.     if isBlocking then
  446.         blockAnim:Stop()
  447.         endBlocking:FireServer()
  448.         isBlocking = false
  449.         task.wait(blockCooldown.Value)
  450.         canBlock = true
  451.     end
  452. end
  453. function playerBlockBroken() --special attack recieved and is blocking
  454.     if canBlock or isBlocking then
  455.         blockAnim:Stop()
  456.         blockBrokenHaptic:Play()
  457.         endBlocking:FireServer()
  458.         isBlocking = false
  459.         canBlock = false
  460.         task.wait(blockBrokenShield.Value)
  461.         canBlock = true
  462.     else
  463.         return false;
  464.     end
  465. end
  466. destroyBlockOpp.OnClientEvent:Connect(function()
  467.     blockBrokenHaptic:Play()
  468.     damagedOpponentHaptic:Play()
  469. end)
  470. userInput.InputBegan:Connect(function(input)
  471.     if toolEquipped then
  472.         if input.KeyCode == defaultBlockKeyboard or input.KeyCode == defaultBlockGamepad then --block
  473.             blockFunction()
  474.         elseif input.KeyCode == defaultSpecialKeyboard or input.KeyCode == defaultSpecialGamepad then --special
  475.             specialAttack()
  476.         elseif input.KeyCode == defaultDodgeKeyboard or input.KeyCode == defaultSpecialGamepad then --ready dodge
  477.             dodgeRequest()
  478.         elseif input.UserInputType == defaultHeavyKeyboard or input.KeyCode == defaultHeavyGamepad then --heavy attack
  479.             heavyAttack()
  480.         end
  481.     else
  482.         return false;
  483.     end
  484. end)
  485. userInput.InputEnded:Connect(function(input)
  486.     if toolEquipped then
  487.         if input.KeyCode == defaultBlockKeyboard or input.KeyCode == defaultBlockGamepad then --block
  488.             endBlockFunction()
  489.         elseif input.KeyCode == defaultSpecialKeyboard or input.KeyCode == defaultSpecialGamepad then --special
  490.             specialAttack()
  491.         elseif input.KeyCode == defaultDodgeKeyboard or input.KeyCode == defaultDodgeGamepad then --ready dodge
  492.             print("tool dodge specification ended")
  493.         elseif input.UserInputType == defaultHeavyKeyboard or input.KeyCode == defaultHeavyGamepad then --heavy attack
  494.             print("heavy attack ended")
  495.         end
  496.     else
  497.         return false;
  498.     end
  499. end)
  500. uitmcbHeavy.Activated:Connect(function()
  501.     heavyAttack()
  502. end)
  503. uitmcbSpecial.Activated:Connect(function()
  504.     specialAttack()
  505. end)
  506. uitmcbBlock.Activated:Connect(function()
  507.     if not isBlocking then
  508.         blockFunction()
  509.     else
  510.         endBlockFunction()
  511.     end
  512. end)
  513.  
  514. local wasBroken = valuesFolder:WaitForChild("BlockWasBroken").Value
  515.  
  516. blockPower:GetPropertyChangedSignal("Value"):Connect(function()
  517.     blockPowerText.Text = tostring(blockPower.Value).."/"..tostring(maxBlockPower.Value)
  518.     if blockPower.Value < 5 and blockPower.Value > 0 and blockPower.Value ~= maxBlockPower.Value then
  519.         blockPowerText.TextStrokeColor3 = Color3.new(1, 1, 1)
  520.         blockingStatus.Image = "rbxassetid://110722851762669"
  521.         blockIconDecor.ImageTransparency = 0
  522.         blockIconDecor.ImageColor3 = Color3.new(1, 0.717647, 0)
  523.         blockBrokenWarnHap:Play()
  524.     elseif blockPower.Value > 4 and blockPower.Value > 0 and blockPower.Value ~= maxBlockPower.Value then
  525.         blockingStatus.Image = "rbxassetid://81606636420148"
  526.         blockPowerText.TextStrokeColor3 = Color3.new(1, 1, 1)
  527.         blockIconDecor.ImageTransparency = 0
  528.         blockIconDecor.ImageColor3 = Color3.new(1, 1, 1)
  529.         blockBrokenWarnHap:Stop()
  530.     elseif blockPower.Value <= 0 and blockPower.Value ~= maxBlockPower.Value then
  531.         blockBrokenWarnHap:Stop()
  532.         blockPowerText.TextStrokeColor3 = Color3.new(1, 1, 1)
  533.         blockingStatus.Image = "rbxassetid://109736467454510"
  534.         blockIconDecor.ImageTransparency = 0.75
  535.         blockIconDecor.ImageColor3 = Color3.new(1, 0, 0)
  536.         blockBrokenHaptic:Play()
  537.         playerBlockBroken()
  538.     elseif blockPower.Value == maxBlockPower.Value and blockPower.Value > 0 then
  539.         blockBrokenWarnHap:Stop()
  540.         blockPowerText.TextStrokeColor3 = Color3.new(0.5, 1, 0.5)
  541.         blockingStatus.Image = "rbxassetid://121584678153800"
  542.         blockIconDecor.ImageTransparency = 0
  543.         blockIconDecor.ImageColor3 = Color3.new(1, 1, 1)
  544.     end
  545. end)
Tags: combat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement