How to disable key X?

Hello guys, I wants block key X. I have script when you work the animation play. When you pick X on keyboard the animation stop. I wants block X :slight_smile: Sorry for my English I from Poland

Work with DisableControlAction()

1 Like

Please write example code with disablecontrolaction :slight_smile:

1 Like
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)

		if xDisable then
			DisableControlAction(0, 73, true) 
		end
	end
end)

and to disable it you have to set โ€œxDisableโ€ to true.

1 Like

Ok, thanks, I test this for 3 hours

1 Like

how can i set xDisable true?

local xDisable = false

example:
if โ€ฆ then
xDisable = true
Wait(2000)
xDisable = false
end

gg and yes

gg and

thank you for uploading this I needed this badly

No problem!
Hope this helps