Log in
Top posting users this week
No user |
Latest topics
[3] Valuable Variables
Page 1 of 1
[3] Valuable Variables
You are still here! Great!
If your previous example worked well, then let's continue!
Today, we are gonna take a travel with variables. They will be one of the most common things you'll use in lua.
A variable is defining a data, what the script definies. A variable can be changed, as it's name says, and therefor, a very useful tool in your hand.
Let's open our script called basic_lesson.lua, and insert this line:
This means, we have a variable, with a string data, contains "This is a varaible"
A variable stands from three parts:
Variable name, the definier and the data
--- testing = "This is a varaible"
A variable name should be unique unless you want to change the other one.
The definier should always be a single equal mark =, no matter what.
The data can be a number
123
a string
"Hello there"
or another variable
testvar
If your previous example worked well, then let's continue!
Today, we are gonna take a travel with variables. They will be one of the most common things you'll use in lua.
A variable is defining a data, what the script definies. A variable can be changed, as it's name says, and therefor, a very useful tool in your hand.
Let's open our script called basic_lesson.lua, and insert this line:
- Code:
testing = "This is a variable"
This means, we have a variable, with a string data, contains "This is a varaible"
A variable stands from three parts:
Variable name, the definier and the data
--- testing = "This is a varaible"
A variable name should be unique unless you want to change the other one.
The definier should always be a single equal mark =, no matter what.
The data can be a number
123
a string
"Hello there"
or another variable
testvar
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Fri Jan 24, 2014 2:19 am by Wolf
» Bugreport #0003 (Solved)
Fri Jan 24, 2014 2:18 am by Wolf
» Server Managment Fees
Wed Jan 22, 2014 12:10 am by Wolf
» Server Managment!
Wed Jan 22, 2014 12:04 am by Wolf
» [3] Valuable Variables
Fri Jan 03, 2014 2:50 am by Wolf