Hello, I have a block button for my combat system, and when it plays it fires a remote to the server and the server makes a bool value inside the player = to true to indicate that the player is blocking. Since hackers can infinitely block, I made it so when blocking you can’t jump and you’re very slow, and if you can jump/are faster then set speed, you get kicked. I can’t figure out why the player is kicked after unblocking?
client
UserInputService.InputBegan:Connect(function(KeyInput,gameProccessed)
if gameProccessed then return end
if KeyInput.KeyCode == Enum.KeyCode.F and BlockDebounce and Stunned.Value == false then
BlockDebounce = false
local WalkSpeed = character.Humanoid.WalkSpeed
local JumpPower = character.Humanoid.JumpPower
game.ReplicatedStorage.Remotes.BlockRemote:FireServer(true,Blocking)
---Blocking is just a bool value inside the character to check if the player is blocking or not
BlockAnimation:Play()
wait(.30)
BlockAnimation:AdjustSpeed(0)
while UserInputService:IsKeyDown(Enum.KeyCode.F) do wait() end
game.ReplicatedStorage.Remotes.BlockRemote:FireServer(false,Blocking,WalkSpeed,JumpPower)
BlockAnimation:AdjustSpeed(1)
wait(3)
BlockDebounce = true
end
end)
server
game.ReplicatedStorage.Remotes.BlockRemote.OnServerEvent:Connect(function(player,value,blocking,speed,jump)
local char = player.Character or player.Character.CharacterAdded:Wait()
if value == true then
char.Humanoid.WalkSpeed = 7
char.Humanoid.JumpPower = 0
else
char.Humanoid.WalkSpeed = speed
char.Humanoid.JumpPower = jump
end
blocking.Value = value
print(blocking.Value)
wait(1)
char.Humanoid.Changed:Connect(function()
if blocking.Value == true then
if char.Humanoid.WalkSpeed ~= 7 or char.Humanoid.JumpPower ~= 0 then
--even when blocking is = to false this still runs?
player:Kick("Nice Exploits")
return
end
end
end)
end)