Created
May 6, 2023 15:33
-
-
Save EncodeTheCode/e275bddb81bcae0e44a7954ff08dbed6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addbind("W") | |
addbind("A") | |
addbind("S") | |
addbind("D") | |
function onPlayerKeyPress(id,key,state) | |
if(key=="W" and state==1) then | |
msg("W is pressed!") | |
elseif(key=="A" and state==1) then | |
msg("A is pressed!") | |
elseif(key=="S" and state==1) then | |
msg("S is pressed!") | |
elseif(key=="D" and state==1) then | |
msg("D is pressed!") | |
end | |
if(key=="W" and state==0) then | |
msg("W has been pressed.") | |
elseif(key=="A" and state==0) then | |
msg("A has been pressed!") | |
elseif(key=="S" and state==0) then | |
msg("S has been pressed!") | |
elseif(key=="D" and state==0) then | |
msg("D has been pressed!") | |
end | |
end | |
addhook("key", "onPlayerKeyPress") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment