HiddenCoders
Welcometo the HiddenCoders forum!

Please log in for additional features, such as posting, replying, and reciving advanced support.

Thank you for visiting out site!

Join the forum, it's quick and easy

HiddenCoders
Welcometo the HiddenCoders forum!

Please log in for additional features, such as posting, replying, and reciving advanced support.

Thank you for visiting out site!
HiddenCoders
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Log in

I forgot my password

Top posting users this week
No user

Latest topics
» Bugreport #0002 (in progress)
[3] Valuable Variables EmptyFri Jan 24, 2014 2:19 am by Wolf

» Bugreport #0003 (Solved)
[3] Valuable Variables EmptyFri Jan 24, 2014 2:18 am by Wolf

» Server Managment Fees
[3] Valuable Variables EmptyWed Jan 22, 2014 12:10 am by Wolf

» Server Managment!
[3] Valuable Variables EmptyWed Jan 22, 2014 12:04 am by Wolf

» [3] Valuable Variables
[3] Valuable Variables EmptyFri Jan 03, 2014 2:50 am by Wolf


[3] Valuable Variables

Go down

[3] Valuable Variables Empty [3] Valuable Variables

Post by Wolf Fri Jan 03, 2014 2:50 am

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:

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
Wolf
Wolf
Team Member
Team Member

Hozzászólások száma : 30
XP : 3942
Reputation : 0
Join date : 2013-10-09

http://hiddencoders.hypeforum.net

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum