so basically i want to do a movement system for my tool. For it to work i need to check if the different Keys (W key, A key, S key, D key) are pressed. Im using an if statement for it but it wont work because you cant put multiple "ands" in an if statement. Heres the code that im stuck with:
if wPressed == true and aPressed == false and sPressed == false and dPressed == false then
Does anybody have a solution to my question?
it wont work because you cant put multiple "ands" in an if statement.
That is incorrect. There is no limit on how many times you use and
in an if statement.
If the code you provided is not working, it means that wPressed
is not the only boolean that is set to true. Try debugging it by using prints to check the variables to see if they are the correct boolean.