Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

[Solved] How can i make this variable be changed for the entire script?

Asked by 1 year ago
Edited 1 year ago

Tittle says it all. Here's the script:

Script:

game.ReplicatedStorage.HLC_CTRLS.W_Began.OnServerInvoke = function(player)
    W_KeyDown = true
    print("Remote function was invoked")
end

if(W_KeyDown)then
    print("Variable was changed.")

end

The first function prints, but the second doesn't. How can i make it be changed for the entire script?

1 answer

Log in to vote
0
Answered by 1 year ago

put the if inside the first function, or define W_KeyDown outside the function

0
Solved already. David0fficial_BR 173 — 1y
Ad

Answer this question