Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RepStorage = game.ReplicatedStorage
- local ServerStorage = game.ServerStorage
- local AttackHandler = require(RepStorage.AttackHandler) -- I didn't want this script being too long so I did all the damage and stuff in a module
- local Keybinds = require(RepStorage.Keybinds) -- keybinds module for damage and stuff
- local Moves = Keybinds.Moves
- local SFXFolder = ServerStorage.SFX
- local Players = game.Players
- -- Remotes
- local Remotes = RepStorage.Remotes
- -- Bindables
- local Bindables = RepStorage.Bindables
- --Block Bar Regeneration
- game:GetService("RunService").Heartbeat:Connect(function(deltaTime) -- regenerating block bar. lets say someone gets hit like until their blockbar is at 50%, you want it to go down after 8 seconds of no combat right? so yeah
- for i, player: Player in Players:GetChildren() do
- local char = player.Character
- if not char then continue end
- local LastCombat = char:GetAttribute("LastCombat")
- if not LastCombat then continue end
- if os.clock() - LastCombat <= 8 then continue end
- local BlockBar = char:GetAttribute("BlockBar")
- if not BlockBar then continue end
- if BlockBar < 0 then
- char:SetAttribute("BlockBar", 0)
- continue
- end
- if BlockBar == 0 then continue end
- char:SetAttribute("BlockBar", BlockBar - (math.ceil(deltaTime*200)/100))
- end
- end)
- -- Move Classes
- local BoxerMoves = Moves.Boxer
- Remotes.Jab.OnServerEvent:Connect(function(...) -- boxing jab, this just puts all arguments into one like current combo and stuff and sends it to the module script that actually has all the scripting for damage and stuff
- AttackHandler.Jab(...)
- end)
- Remotes.Uppercut.OnServerEvent:Connect(function(...)
- AttackHandler.Uppercut(...)
- end)
- Remotes.Block.OnServerEvent:Connect(function(plr, val)
- local char = plr.Character
- if val then
- char.Humanoid.WalkSpeed = 4
- print("hes blocking")
- elseif not plr.Character:GetAttribute("BlockBroken") then
- char.Humanoid.WalkSpeed = 16
- end
- char:SetAttribute("Blocking", val)
- if char:GetAttribute("Cooldown") > os.clock() then
- char:SetAttribute("Blocking", false)
- end
- print("set to",val)
- end)
- Bindables.Jab.Event:Connect(function(...)
- AttackHandler.Jab(...)
- end)
- Bindables.Uppercut.Event:Connect(function(...)
- AttackHandler.Uppercut(...)
- end)
- Bindables.Block.Event:Connect(function(char, val)
- if val then
- char.Humanoid.WalkSpeed = 4
- else
- char.Humanoid.WalkSpeed = 16
- end
- char:SetAttribute("Blocking", val)
- if char:GetAttribute("Cooldown") > os.clock() then
- char:SetAttribute("Blocking", false)
- end
- print("set to",val)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement