Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

lua roblox global variables

--Our variable is this
var="a"
--and we cant use it in a function it gives we an error
function abc()
	print(var)
end
abc()
--Output: Error
--We can make it a global variable with using _G. method
_G.var2="b"
function cba()
	print(_G.var2)
end
cba()
--Output: b
 
PREVIOUS NEXT
Tagged: #lua #roblox #global #variables
ADD COMMENT
Topic
Name
6+9 =