Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RepStorage = game:GetService('ReplicatedStorage')
- local CombatModule = RepStorage:WaitForChild('CONSTRUCTOR_CombatSystem')
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild('Humanoid')
- local animators = character:WaitForChild('CombatAnimators')
- local animations = {[1]=animators:WaitForChild('RightDiagonal');[2]=animators:WaitForChild('LeftDiagonal');[3]=animators:WaitForChild('RightHorizontal')}
- local animationTracks = {}
- for i = 1, #animations do
- animationTracks[i] = humanoid:LoadAnimation(animations[i])
- end
- local UIS = game:GetService('UserInputService')
- local playerCombatInfo = require(CombatModule).getPlayerCombatInfo(player)
- local debounce = 0
- local timestamp = tick()
- local isHolding = false
- local comboInc = 0
- local mouse = player:GetMouse()
- local EquipTrack = humanoid:LoadAnimation(script:WaitForChild('EquipAnim'))
- UIS.InputBegan:Connect(function(input,isTyping)
- if not isTyping and tick() - timestamp >= debounce then
- timestamp = tick()
- debounce = 0
- if input.KeyCode == Enum.KeyCode.One then
- isHolding = not isHolding
- playerCombatInfo = require(CombatModule).getPlayerCombatInfo(player)
- if playerCombatInfo.Weapon then
- debounce = 0.5
- EquipTrack:Play()
- if isHolding then
- wait(0.25)
- end
- playerCombatInfo.Holding = not playerCombatInfo.Holding
- CombatModule.CombatSystem_SendInputData:InvokeServer('Sword_Equip')
- end
- elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
- playerCombatInfo = require(CombatModule).getPlayerCombatInfo(player)
- if playerCombatInfo.Holding == false then return end
- debounce = 0.5
- comboInc = comboInc < 3 and comboInc + 1 or 1
- local track = animationTracks[comboInc]
- track:Play()
- CombatModule.CombatSystem_SendInputData:InvokeServer('HitBox_Connect',{playerCombatInfo.Weapon.Handle.Hitbox})
- track.Stopped:Connect(function()
- CombatModule.CombatSystem_SendInputData:InvokeServer('HitBox_Disconnect',{playerCombatInfo.Weapon.Handle.Hitbox})
- end)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement