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

My global variable is not defined?

_G.Apple = true

while Apple == true do

It claims that Apple is undefined (Outside of the while loop script is where the variable is defined.)

Why is this not defined?

2 comments

0

Thank you.

0

_G.Apple not just Apple

1 answer

When defining a global variable, you also access it in the same manner.

_G.Apple =  true


while _G.Apple == true do
	-- whatever you want to do
end

_G.Apple and just Apple are two completely different variables.

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