Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

1 comment

0

Solved already.

This discussion is preserved as it was. New answers, comments, and votes are closed.