[Release] Accidental Punch

Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
DisableControlAction(1, 140, true)
if not IsPlayerTargettingAnything(PlayerId()) then
DisableControlAction(1, 141, true)
DisableControlAction(1, 142, true)
end
end
end)

When you tab out you click on the game to re-focus it and sometimes you can hit people because of that. If you add this you can’t punch unless you hold right-click and focus.
It also prevents shift punch spamming!

Dumb Install Hint: Add to any client.lua you can find

Press :heart: if helped.

6 Likes

Neat script but has its downsides much love <3

Way too simple (less than 20 lines of code) for a release, moved to tutorials section instead to serve as an example.

but this is not a tutorial, as I am not showing how to do it. It’s the actual script lines?!

Read the Releases section F.A.Q. and then try to tell me I’m wrong, please.

Thank you!

1 Like