Currently, this is blocking script on the server.
-- \\ Get-Service Variables // --
local RS = game:GetService("ReplicatedStorage")
-- \\ Misc. Variable // --
local LT = workspace.LivingThings
local DB = false
-- \\ Events Variables // --
local Block = RS.CombatEvents.Block
local Release = RS.ReleaseEvents.Release
-- \\ Functions // --
Block.OnServerEvent:Connect(function(Player)
local Character = Player.Character
if DB == true then return end
if DB == false then
if Character:GetAttribute("CanAttack", true) or Character:GetAttribute("Running", true) then return end
Character:SetAttribute("IsBlocking", true)
end
end)
Release.OnServerEvent:Connect(function(Player)
local Character = Player.Character
task.wait(3)
DB = false
Character:SetAttribute("IsBlocking", false)
end)
After using this blocking script, the combat seems to stop working, and if I were to un-disable the parry script, I’m infinitely doing the parrying script even though there is a debounce.
Local Script for Blocking
--\\ GetServices //--
local RS = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local SSS = game:GetService("ServerScriptService")
local RF = game:GetService("ReplicatedFirst")
local CS = game:GetService("CollectionService")
--\\ Variables //--
local Held = UIS:IsKeyDown(Enum.KeyCode.F)
local Combat = RS.CombatEvents.Combat
local Debounce = false
local ButtonDown = false
local Players = game:GetService("Players")
-- \\ Player-Related Variables // --
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
-- setting speed
local Humanoid = Character:WaitForChild("Humanoid")
local walks = Humanoid.WalkSpeed
local Blocks = walks/2
-- \\ Animation Variables // --
local Anim = script.BlockAnims
local Blocker = Anim.Blocking
local BlockinAnim = Character.Humanoid:LoadAnimation(Blocker)
UIS.InputBegan:Connect(function(Input, IsTyping)
if Input.KeyCode == Enum.KeyCode.F and Debounce == false then
if not IsTyping then
if not CS:HasTag(Player, "GuardBroken") then
BlockinAnim.Looped = true
Debounce = true
ButtonDown = true
RS.CombatEvents.Block:FireServer()
Humanoid.WalkSpeed = Blocks
BlockinAnim:Play()
end
end
end
end)
UIS.InputEnded:Connect(function(input, typing)
if typing then return end
if input.KeyCode == Enum.KeyCode.F and ButtonDown == true then
RS.ReleaseEvents.Release:FireServer("Release")
BlockinAnim:Stop()
BlockinAnim.Looped = false
Humanoid.WalkSpeed = 15
ButtonDown = false
print("Grah grah boom")
wait(.9)
Debounce = false
end
end)
if Character:GetAttribute("IsBlocking") == false or Character:GetAttribute("Parry") == false or CS:HasTag(Player, "GuardBroken") then
BlockinAnim.Looped = false
BlockinAnim:Stop()
end
Now, once I do this, I check the attributes, and see if blocking is still true. In which it is not!
-- \\ Player-Related Variables //--
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HUM = Character:WaitForChild("Humanoid")
local Humrp = Character:WaitForChild("HumanoidRootPart")
-- \\ Get-Service Variables // --
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedFirst")
-- \\ Server-Script-Variables // --
local SSS = game:GetService("ServerScriptService")
local RS = game:GetService("ReplicatedStorage")
local RunS = game:GetService("RunService")
local SP = game:GetService("StarterPack")
local Combat101 = SSS:FindFirstChild("CombatHandler")
local CAS = game:GetService("ContextActionService")
--local CM = require(RS.CheckHumanoid)
-- \\ Cooldowns // --
local Debounce = false
local CDS = {
1,
2
}
local CurrTime = 0
local PrevTime = 0
local HoldingTool = false
-- \\ Misc. Variables // --
local Count = 0
local SwingDelay = 0.5
local AirKickEnabled = false
local AerialDebounce = false
-- \\ Functions // --
function Grippy()
Character.ChildAdded:Connect(function(NewChild)
if NewChild:IsA("Tool") then
HoldingTool = true
end
end)
end
function unGrippy()
Character.ChildRemoved:Connect(function(RemovedChild)
if RemovedChild:IsA("Tool") then
HoldingTool = false
end
end)
end
HUM.StateChanged:Connect(function(oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
if not AirKickEnabled and AerialDebounce then
wait(.02)
if HUM:GetState() == Enum.HumanoidStateType.Freefall then
AirKickEnabled = true
AerialDebounce = true
task.wait(15)
AirKickEnabled = false
AerialDebounce = false
elseif HUM:GetState() == Enum.HumanoidStateType.Landed then
AirKickEnabled = false
task.wait(30)
end
end
end
end)
UIS.InputBegan:Connect(function(Input, Processed)
Grippy()
if Processed then
return
elseif Input.UserInputType == Enum.UserInputType.MouseButton1 and not UIS:IsKeyDown(Enum.KeyCode.F) then
if HoldingTool == true then
return
elseif HoldingTool == false then
if Debounce == false then
Debounce = true
CurrTime = os.clock()
local PT = CurrTime - PrevTime
if PT < 1 then
Count += 1
if Count > 4 then
print("Resetting Combo.")
Count = 1
end
else
Count = 1
end
print("Ugh?")
RS.CombatEvents.Combat:FireServer(Count)
unGrippy()
end
end
end
end)
RS.CombatEvents.Combat.OnClientEvent:Connect(function(bool)
PrevTime = CurrTime
if bool then
wait(CDS[2])
Debounce = false
else
Debounce = false
end
end)
Apparently, the script is firing after adding a few logpoints checking if that was the case, but the only checks I have in the server script are
--[[if Character:GetAttribute("CanAttack") == true and Character:GetAttribute("IsBlocking") == true then
print("AUGHHHHHHH")
return
end]]
if Character:GetAttribute("IsBlocking") == true then
return
end
if CS:HasTag(Character, "Stun") then
return
end
But I doubt this is the reason the script stops working, since I press once and the script isn’t working at ALL. So, I’d enjoy some assistance with this ngl.
Apparently, it seems like the delay of the blocking stops the combat script from working? If I wait for the print statement in the blocking script, the combat works fine, but if I don’t, the blocking script stops working.
Nevermind, it’ll still break sometimes.