How to Disable Mouse Click when Dead?(Weapon Generator Glitch)

People now discovered a Glitch where they Open the inventory and someone kills him( because opening inventory after Death is Disabled), after that he drops the weapon he was carrying and gets a revive, so after the revive, the weapon he dropped remains in his inventory the same and also the other person gets the same duplicate weapon. Thats how they are generating weapon from 1 to 100. So i want to disable mouse click after dead so that he cant click on the item and drop it, although everything is disabled on esx_ambulancejob but only mouse click is enabled. Help me out

The better solution would be to close out of the inventory hud when someone dies.


How to do that?
what trigger button should use to do that?

– Disable most inputs when dead
while true do

	if IsDead then
		EnableControlAction(0, Keys['G'], true)
		EnableControlAction(0, Keys['T'], true)
		EnableControlAction(0, Keys['E'], true)
		EnableControlAction(0, Keys['F1'], true)
		EnableControlAction(0, Keys['ENTER'], true)
		EnableControlAction(0, Keys['LEFT'], true)
		EnableControlAction(0, Keys['RIGHT'], true)
		EnableControlAction(0, Keys['DOWN'], true)
		EnableControlAction(0, Keys['TOP'], true)
		EnableControlAction(0, Keys['BACKSPACE'], true)
		EnableControlAction(0, Keys['PAGEUP'], true)


Either trigger an existing event that closes the nui for the inventory hud or you’ll have to create a new event and when someone dies have it trigger the event so if they have it open it will close it.