Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/10/23 in all areas

  1. No. Since "lctrl" and "mouse1" are not equal to each other, If key is "lctrl" then by definition it cannot be "mouse1", therefore this conditional always evaluates false, and cancelEvent is never called. If you want to block either lctrl or mouse1, keep the logical connective as or. addEventHandler("onClientKey", root, function(key, pressState) if key == "lctrl" or key == "mouse1" then -- block the use of either key cancelEvent(true) end end ) If you want to block both from being used at the same time, you instead have to use an internal state to remember whether the other key is pressed. For example, have a variable (bool) remember whether lctrl is currently pressed or not, and when key == "mouse1" you can test local lctrlIsPressed = -- assigned at previous invocation of onClientKey addEventHandler("onClientKey", root, function(key, pressState) if key == "lctrl" then lctrlIsPressed = pressState -- remember the pressState of lctrl elseif key == "mouse1" and pressState and lctrlIsPressed == true then -- only if mouse1 was now pressed and lctrl is already pressed cancelEvent(true) end end ) Note the example above is only half correct; it prevents the detection of pressing mouse1 while lctrl is pressed, but not the opposite; if one clicks and holds mouse1 and only then presses lctrl, this will not be prevented from detection by the game.
    1 point
  2. what variable do I put in DX? addEventHandler("onClientTransferBoxProgressChange", root, function(size, total) barprogress = ( size / total ) end ) addEventHandler("onClientTransferBoxVisibilityChange", root, function(vis) barvisible = vis end ) barvisible = isTransferBoxVisible() dxDrawImage(botX+sizeX+343, botX2+sizeX2+701, 592/100*barvisible, 6, 'assets/progress_bar.png', 0, 0, 0, tocolor(43, 171, 226, 255), true) --or dxDrawImage(botX+sizeX+343, botX2+sizeX2+701, 592/100*barprogress, 6, 'assets/progress_bar.png', 0, 0, 0, tocolor(43, 171, 226, 255), true) sorry, but I confused
    1 point
×
×
  • Create New...