Tittle says it all. Here's the script:
Script:
1 | game.ReplicatedStorage.HLC_CTRLS.W_Began.OnServerInvoke = function (player) |
2 | W_KeyDown = true |
3 | print ( "Remote function was invoked" ) |
4 | end |
5 |
6 | if (W_KeyDown) then |
7 | print ( "Variable was changed." ) |
8 |
9 | end |
The first function prints, but the second doesn't. How can i make it be changed for the entire script?
put the if inside the first function, or define W_KeyDown outside the function