Stop Combatrolling (0 - 0.01 resmon )

Hello guys ive seen many struggling with blocking the combatroll and ive got the best performed way for you to block it.

Simply add this code in any client.lua

CreateThread(function()
  while true do 
    local wait_time = 1000 
    if IsPedArmed(PlayerPedId(), 4 or 2) and IsPlayerFreeAiming(PlayerId())  then 
      wait_time = 0 
      DisableControlAction(0, 22, true)
    end
    Wait(wait_time)
  end
end)

Idle:

When armed:

7 Likes

Thanks to @DirkScriptz for helping out <3

1 Like

there is a problem in your snippet if i am armed i cant jump, you should check if player is armed and then check if player is aiming then block the key not when player is armed

Youre absolutely right change the or request to and

Code was already beeing fixed

tbh u should remove the flag that allow rolling while holding the weapon in weapons.meta ¯_(ツ)_/¯

Not everyone has access to all metas or knows how to change it. If you know how let us know!

How i can make to have only 1,5 seconds delay to the combatroll because now is over 8 seconds and i try to fix this.

You can still combat roll by clicking left mouse and space quicky. You don’t need to be aiming down to actually combat roll.

1 Like

Set sleep value to 0

Change the wait

I can still do the roll

yo if u dont mind can u telll me the code u had at first to make it where u cant jump when armed

just use this inside of the client.lua

Citizen.CreateThread(function()
while true do
Citizen.Wait(5)
if IsPedArmed(GetPlayerPed(-1), 4 | 2) then
DisableControlAction(0, 22, true)
end
end
end)

Alternatively as of f2f9858 you are able to now directly see if a ped is doing CTaskCombatRoll.

You may run another thread as a failsafe if they managed to get past the disabled control:

Citizen.CreateThread(function()
    while true do
        local playerPed = PlayerPedId()
        local isCombatRolling = GetIsTaskActive(playerPed, 3)

        if isCombatRolling then
            ClearPedTasksImmediately(playerPed)
        end

        Citizen.Wait(100) -- Short Enough
    end
end)

There is probably a more professional way of doing this, but it’s good enough.

1 Like