Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

how to program lua roblox variables

--These are variables
variable = "Hi"
print(variable)
--now you will see in the output Hi when you have press the button play
Comment

global variables lua

--[[
Global variables don't need a declaration like "local." Instead, you'd just
write like this:
]]--

variable = --value

--[[ 
Note, you don't always have to even assign a value to a variable. You can
use it for the first time and get a value of "nil" which you can update later.
]]--
Comment

PREVIOUS NEXT
Code Example
Lua :: lua add table to value 
Lua :: roblox rotate model 
Lua :: how to make a color changing brick in roblox studio 
Lua :: lua add 1 to a variable 
Lua :: repeat until lua 
Lua :: Random Map in roblox 
Lua :: how to define a player roblox studio 
Lua :: lua game code 
Lua :: roblox table find 
Lua :: fivem commands example lua 
Lua :: lua wait function 
Lua :: delete part on touch roblox 
Lua :: ex: CFrame to vector3 roblox lua 
Lua :: gun that shoot automaticly roblox 
Lua :: roblox set color of text 
Lua :: <font color="" roblox 
Lua :: roblox part touched 
Matlab :: matlab title with variable 
Matlab :: log matlab 
Matlab :: sin in scilab 
Basic :: random numbers visual basic 
Basic :: API Key Authentication, Basic , Pasword Grant, Client Credentials 
Elixir :: elixir reverse list 
Elixir :: elixir pick out elements in list 
Scala :: scala map example 
Scala :: currying scala 
Excel :: google sheets sort column by element frequency 
Perl :: perl do while loop 
Pascal :: pascal pause 
Powershell :: install python command line windows 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =