I have a problem it's when I want (example: If someone presses on E and well it goes in true and if he press again it's become then false)
Bool = true function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.Tab then print(true) Bool = false print(false) end end game:GetService('UserInputService').InputBegan:connect(onKeyPress)
Simple, with your current code, add a few lines.
```lua local Bool = true
function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.Tab then -- you said E not tab idk if you actually wrote this code if Bool == true then Bool = false print('False') else Bool = true print('True') end end end
game:GetService('UserInputService').InputBegan:connect(onKeyPress) ``` I'm not sure if you actually wrote this code, if you did you should know about if statements and setting values to different values. Don't steal from others, instead, learn.
-- Your orange, BlackOrange3343