Absolute beginner's guide to scripting: Difference between revisions

no edit summary
>Tenal
No edit summary
>Tenal
No edit summary
Line 5: Line 5:
|}
|}


__TOC__
==Introducing ROBLOX Lua==
 
==Introducing Lua: Roblox's Programming Language==
This tutorial shows you how to do some basic scripting, or programming. However, you must follow instructions exactly.   
This tutorial shows you how to do some basic scripting, or programming. However, you must follow instructions exactly.   


{{EmphasisBox/start|green}}'''Please Note:''' In order to learn scripting, you must '''do''' the actions.  Reading will not help that much.  Actually '''FOLLOW''' the instructions. {{EmphasisBox/end}}
{{EmphasisBox/start|green}}'''Please Note:''' In order to learn scripting, you must '''do''' the actions.  Reading will not help that much.  Actually '''FOLLOW''' the instructions. {{EmphasisBox/end}}


=== What is scripting? ===
=== What is scripting? ===
Scripting is a way to tell the computer what to do.  However, computers can only understand commands to do things if you tell them '''exactly''' what to do, in a specific code or language. ROBLOX  [[RBX.lua.Script (Object)|Scripts]] are commands in a coding language called [[Lua_Help|Lua]]. Lua is not-so-hard to understand, depending on the way you want to use it. Lua was made to be simple to read and easy to understand, along with being simple to put into games. Lua was '''not''' specifically designed for ROBLOX.  Instead, it was designed to be put into games ''like'' ROBLOX.  The Lua in ROBLOX is a version of 'normal' Lua that has been modified for ROBLOX.  We will be learning this modified version.   
Scripting is a way to tell the computer what to do.  However, computers can only understand commands to do things if you tell them '''exactly''' what to do, in a specific code or language. ROBLOX  [[RBX.lua.Script (Object)|Scripts]] are commands in a coding language called [[Lua_Help|Lua]]. Lua is not-so-hard to understand, depending on the way you want to use it. Lua was made to be simple to read and easy to understand, along with being simple to put into games. Lua was '''not''' specifically designed for ROBLOX.  Instead, it was designed to be put into games ''like'' ROBLOX.  The Lua in ROBLOX is a version of 'normal' Lua that has been modified for ROBLOX.  We will be learning this modified version.   


{{EmphasisBox/start|red}}'''Please Note:''' It's "Lua", not "LUA". It's not an acronym, it's a noun, so don't capitalize the last two letters, or not capitalize the first. {{EmphasisBox/end}}
{{EmphasisBox/start|red}}'''Please note:''' It's "Lua", not "LUA", because Lua is not an acronym.{{EmphasisBox/end}}


A key addition to ROBLOX Lua is the ability to navigate a tree of objects in your game using a '''parent-child relationship''' between objects (sometimes called 'Instances' in ROBLOX Lua)
A key addition to ROBLOX Lua is the ability to navigate a tree of objects in your game using a '''parent-child relationship''' between objects (sometimes called 'Instances' in ROBLOX Lua)


== Your first program ==
== Your first program ==
You are about to make your very first script - a script to kill yourself. There is multiple ways to execute (or run) code in ROBLOX, but you will be executing the script from a place in ROBLOX [[Studio]] called the [[Scripting#Fundamentals|Command Bar]]. The Command Bar allows you to execute a single line of script instantly in a blank [[place]]. The command bar will only run one line of code at a time.  The first thing we want to do, is to open up the command bar, which is in ROBLOX [[studio]].   
You are about to make your very first script - a script to kill yourself. There is multiple ways to execute (or run) code in ROBLOX, but you will be executing the script from a place in ROBLOX [[Studio]] called the [[Scripting#Fundamentals|command bar]]. The command bar allows you to execute a single line of script instantly in a blank [[place]]. The command bar will only run one line of code at a time.  The first thing we want to do, is to open up the command bar, which is in ROBLOX [[Studio]].   


{{TitledBox/start|heading=How do I open [[Studio]], and how do I enable the command bar?}}
{{TitledBox/start|heading=How do I open [[Studio]], and how do I enable the command bar?}}
Anonymous user