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)

3 comments
this is a help site, not a code giving site. try to do it yourself and if you cant then post your script and well see what the error is
Use UserInputService:IsKeyDown(Enum.KeyCode.KeyStroke), it returns a Boolean. You could always just do Boolean = (not Boolean) too.
That way it'll always flip between true/false.