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!
Log in

I forgot my password

Top posting users this week

Latest topics
» Bugreport #0002 (in progress)
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


[3] Valuable Variables

Go down

[3] Valuable Variables

Post by Wolf on 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
avatar
Wolf
Team Member
Team Member

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

View user profile http://hiddencoders.hypeforum.net

Back to top Go down

Back to top

- Similar topics

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