Jump to content

How to Disable "CTRL" Key ?


Recommended Posts

Posted (edited)

I don't want the player take a punch


I need disable "CTRL" key for impeding that player take a punch.

 

I try this:

 toggleControl ( source, "fire", false )

but only disable mouse key fire... and doesn't disable the "CTRL" key fire ... 

Edited by ronaldoguedess
Posted
4 hours ago, LilDawage said:

toggleControl('action',false) , use it

I did have tried that, but this only disable mouse key fire... and doesn't disable the "CTRL" key fire

6 hours ago, XaskeL said:

toggleControl('action',false)

I did have tried that, but this only disable mouse key fire... and doesn't disable the "CTRL" key fire

10 hours ago, killerProject said:

Try this


"onClientKey"

cancelEvent

 

Thanks Man!
It's Works now!

function playerPressedKey(button, press)
    if (press) then 
        if button == "lctrl" or button == "rctrl"  then 
            cancelEvent()     
            return true 
        end
    end
end
addEventHandler("onClientKey", root, playerPressedKey)

 

  • Like 1
Posted

Do you want to forbid people from using the 'fire' control? Either by mouse button or ctrl?

Because players could simply rebind that action to eg. ALT and they will be able to 'fire' again.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...