Disable Pistol close whipping

Hey, i searched for a script which disables R attack when you’re close to someone but i didn’t find sth except weapondrop script, which i don’t want to use because i don’t want guns to get dropped or sth like that. Just disable the close pistol whipping, any ideas? thanks :slight_smile:

Put this in a client-script :slight_smile:

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
		local ped = PlayerPedId()
            	if IsPedArmed(ped, 6) then
	    	DisableControlAction(1, 140, true)
            	DisableControlAction(1, 141, true)
            	DisableControlAction(1, 142, true)
        end
    end
end)

Source: https://github.com/Deziel0495/WeaponDrop/blob/master/WeaponDrop/client.lua

6 Likes

Thank you sooo much! works fine ^^

Hey this was working fine on my server since yesterday it doesnt work…

works fine for me although i can nolonger use the katana,shiv and karambit that i added to my server any ideas?