User:Emess/Introduction to Scripting

From Legacy Roblox Wiki
Jump to navigationJump to search

Introduction

Introduction to Tutorial

Welcome to this tutorial! These tutorials have been written for the main purpose of teaching new coders with little or no experience in scripting. Anyone from beginner to expert is free to read these tutorials.

This tutorial might be intimidating, but it is recommended that you read one paragraph at a time. The reason why people prefer 'scripting tutors' is because they would rather read and learn line by line instead of reading a full wall of text. Take your time to read it, because there is no suggested amount of time spent on each section. Don't skip a section just because you understand what the topic goes over because the concepts tend to build on from each section.

If you have any feedback on this tutorial, feel free to send me a private message.

Introduction to Lua

Lua was created by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes in 1993 at the Pontifical Catholic University of Rio de Janeiro in Brazil. It was made primarily to be embedded inside programs as a scripting language. It is used today in many places such as World of Warcraft, Garry's Mod, Roblox, and much more.

Example
Let's apply the classic "Hello world" tradition on Lua:
print("Hello world!") --> Hello world!


Getting ready

You can download and install Roblox by clicking here. When downloading is done, go to your Downloads folder and click it to install. When it is done installing, go to Start > Programs > Roblox > Roblox Studio. Roblox Studio is the program where we build and script.

Types and Values

There are eight types in Lua:

  • nil: The absence of a value
  • boolean: True or false
  • number: 1, 2, 3, 4, ...
  • string: A sequence of 0 to more than enough characters
  • userdata: A pseudo-table
  • function: A group of statements that optionally returns a value
  • thread: Script execution
  • table: A group of values