Cookbook: Difference between revisions
>Camoy cookbook init |
>JulienDethurens →Table of Contents: Nobody likes ugly underscores. Let's replace them by spaces! :D |
||
(60 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__TOC__ | |||
==Author== | |||
The entire cookbook was written by [[Camoy]]. | The entire cookbook was written by [[Camoy]]. | ||
==Preface== | |||
The RBX framework for Lua provides an API for creating 3D games for the ROBLOX game. The API has a vast variety of functionality such as functions for moving in game players to properties controlling custom in game GUI. The API is easy to use and is quite powerful. This book will cover the basics of the framework and what you will need in order to start programming your own ROBLOX games. | The RBX framework for Lua provides an <abbr title="Application Programming Interface">API</abbr> for creating 3D games for the ROBLOX game. The API has a vast variety of functionality such as functions for moving in game players to properties controlling custom in game <abbr title="Graphic User Interface">GUI</abbr>s. The API is easy to use and is quite powerful. This book will cover the basics of the framework and what you will need in order to start programming your own ROBLOX games. | ||
Getting started is easy, just head on over to http://www.roblox.com/Install/Download.aspx in order to download the ROBLOX IDE (called Roblox Studio), and the browsing client. | Getting started is easy, just head on over to the [http://www.roblox.com/Install/Download.aspx download page] in order to download the ROBLOX <abbr title="Integrated Development Environment">IDE</abbr> (called Roblox Studio), and the browsing client. | ||
This book assumes a prerequisite knowledge of Lua, however if you do not know Lua at all, don’t turn this book away yet. There are many good resources in learning Lua (one especially helpful resource is http://www.lua.org/pil/). Even if you have no prior knowledge to Lua, in the early chapters, simple Lua syntax will be explained. | This book assumes a prerequisite knowledge of Lua, however if you do not know Lua at all, don’t turn this book away yet. There are many good resources in learning Lua (one especially helpful resource is [http://www.lua.org/pil/ here]). Even if you have no prior knowledge to Lua, in the early chapters, simple Lua syntax will be explained. | ||
The documentation for the ROBLOX framework can be found at | The documentation for the ROBLOX framework can be found at [[Roblox|here, at the wiki]]. Under the “Building and Scripting” category, you will find a link to the “Scripting Reference” and the “Class Reference”. The “Scripting Reference” page is an index of the many scripting articles already written on the wiki site. You may find it useful to check out some of these articles as well. Under the “Class Reference” section, you will find all the ROBLOX objects and will be able to interactively explore their properties, methods, events, and general information. The ROBLOX IDE also has an “Object Browser” (found under Help --> Object Browser), however this is not as comprehensive as the wiki documentation. | ||
In general, this book will provide solutions and examples of many types of problems you may need to solve when building a ROBLOX game. The difficulty level progresses as the book progresses. It is suggested that you read the book cover to back, however if there a certain solution that you need, feel free to jump to it. | In general, this book will provide solutions and examples of many types of problems you may need to solve when building a ROBLOX game. The difficulty level progresses as the book progresses. It is suggested that you read the book cover to back, however if there a certain solution that you need, feel free to jump to it. | ||
[[ | ==Table of Contents== | ||
#[[Cookbook (Chapter 1)|Basics]] | |||
##[[Cookbook (Chapter 1)#Part Instantiation|Part Instantiation]] | |||
##[[Cookbook (Chapter 1)#Color and Transparency|Color and Transparency]] | |||
##[[Cookbook (Chapter 1)#Applying the Touched Event|Applying the Touched Event]] | |||
##[[Cookbook (Chapter 1)#Killing Players|Killing Players]] | |||
##[[Cookbook (Chapter 1)#Removing Limbs|Removing Limbs]] | |||
##[[Cookbook (Chapter 1)#Handling Non-Existent Objects|Handling Non-Existent Objects]] | |||
##[[Cookbook (Chapter 1)#Creating a Kill Brick|Creating a Kill Brick]] | |||
##[[Cookbook (Chapter 1)#Removing Multiple Limbs|Removing Multiple Limbs]] | |||
##[[Cookbook (Chapter 1)#Removing All Character Parts|Removing All Character Parts]] | |||
##[[Cookbook (Chapter 1)#Killing All Players|Killing All Players]] | |||
##[[Cookbook (Chapter 1)#Killing Random Players on Interval|Killing Random Players on Interval]] | |||
##[[Cookbook (Chapter 1)#Using an Exception Table|Using an Exception Table]] | |||
##[[Cookbook (Chapter 1)#Killing Spawning Characters|Killing Spawning Characters]] | |||
##[[Cookbook (Chapter 1)#Creating a Message|Creating a Message]] | |||
##[[Cookbook (Chapter 1)#Debounce|Debounce]] | |||
##[[Cookbook (Chapter 1)#Creating a Clickable Part|Creating a Clickable Part]] | |||
##[[Cookbook (Chapter 1)#Touch Activated Explosion|Touch Activated Explosion]] | |||
##[[Cookbook (Chapter 1)#Dance Floor|Dance Floor]] | |||
##[[Cookbook (Chapter 1)#Creating a Healing Part|Creating a Healing Part]] | |||
##[[Cookbook (Chapter 1)#Creating a Restricted Access Door|Creating a Restricted Access Door]] | |||
##[[Cookbook (Chapter 1)#Creating an Invisibility Part|Creating an Invisibility Part]] | |||
#[[Cookbook (Chapter 2)|Positioning]] | |||
##[[Cookbook (Chapter 2)#Positioning Types|Positioning Types]] | |||
##[[Cookbook (Chapter 2)#Simple Part Positioning|Simple Part Positioning]] | |||
##[[Cookbook (Chapter 2)#Overlapping Positioning|Overlapping Positioning]] | |||
##[[Cookbook (Chapter 2)#Simple CFrame Positioning|Simple CFrame Positioning]] | |||
##[[Cookbook (Chapter 2)#Rotating Toward Another Position|Rotating Toward Another Position]] | |||
##[[Cookbook (Chapter 2)#Rotating in Radians|Rotating in Radians]] | |||
##[[Cookbook (Chapter 2)#Rotating in Degrees|Rotating in Degrees]] | |||
##[[Cookbook (Chapter 2)#Relative Positioning|Relative Positioning]] | |||
##[[Cookbook (Chapter 2)#Getting Relative Position|Getting Relative Position]] | |||
##[[Cookbook (Chapter 2)#Using the Rotational Matrix|Using the Rotational Matrix]] | |||
##[[Cookbook (Chapter 2)#Using Lerp|Using Lerp]] | |||
##[[Cookbook (Chapter 2)#Simple GUI Positioning|Simple GUI Positioning]] | |||
##[[Cookbook (Chapter 2)#Centering GUI|Centering GUI]] | |||
#[[Cookbook (Chapter 3)|GUI]] | |||
##[[Cookbook (Chapter 3)#Introduction|Introduction]] | |||
##[[Cookbook (Chapter 3)#Text Label Instantiation|Text Label Instantiation]] | |||
##[[Cookbook (Chapter 3)#Text Style|Text Style]] | |||
##[[Cookbook (Chapter 3)#Frame Styling|Frame Styling]] | |||
##[[Cookbook (Chapter 3)#Image Instantiation|Image Instantiation]] | |||
##[[Cookbook (Chapter 3)#Creating a Button|Creating a Button]] | |||
##[[Cookbook (Chapter 3)#Creating a Fading GUI|Creating a Fading GUI]] | |||
##[[Cookbook (Chapter 3)#Text Box Input|Text Box Input]] | |||
##[[Cookbook (Chapter 3)#Using Adornment GUI|Using Adornment GUI]] | |||
##[[Cookbook (Chapter 3)#Creating a Resize GUI|Creating a Resize GUI]] | |||
##[[Cookbook (Chapter 3)#Creating Custom 3D GUI|Creating Custom 3D GUI]] | |||
#[[Cookbook (Chapter 4)|Beyond the Basics]] | |||
##[[Cookbook (Chapter 4)#Using BrickColor|Using BrickColor]] | |||
##[[Cookbook (Chapter 4)#Using Color3|Using Color3]] | |||
##[[Cookbook (Chapter 4)#Using Base Classes|Using Base Classes]] | |||
##[[Cookbook (Chapter 4)#Using Enumerations|Using Enumerations]] | |||
##[[Cookbook (Chapter 4)#Event Members|Event Members]] | |||
##[[Cookbook (Chapter 4)#Disconnecting a Connection|Disconnecting a Connection]] | |||
##[[Cookbook (Chapter 4)#Using LocalScripts|Using LocalScripts]] | |||
##[[Cookbook (Chapter 4)#Creating a Regeneration Button|Creating a Regeneration Button]] | |||
##[[Cookbook (Chapter 4)#Creating a Template|Creating a Template]] | |||
##[[Cookbook (Chapter 4)#Creating a Leaderboard|Creating a Leaderboard]] | |||
##[[Cookbook (Chapter 4)#Creating a Point Earning Button|Creating a Point Earning Button]] | |||
##[[Cookbook (Chapter 4)#Applying the Chatted Event|Applying the Chatted Event]] | |||
##[[Cookbook (Chapter 4)#Applying the Changed Event|Applying the Changed Event]] | |||
##[[Cookbook (Chapter 4)#Applying the ChildAdded/Removing Event|Applying the ChildAdded/Removing Event]] | |||
##[[Cookbook (Chapter 4)#Descendants|Descendants]] | |||
##[[Cookbook (Chapter 4)#Creating a Marquee|Creating a Marquee]] | |||
##[[Cookbook (Chapter 4)#Using a SpecialMesh|Using a SpecialMesh]] | |||
##[[Cookbook (Chapter 4)#Using a VehicleSeat|Using a VehicleSeat]] | |||
##[[Cookbook (Chapter 4)#Using Fire|Using Fire]] | |||
#[[Cookbook (Chapter 5)|Tools and HopperBins]] | |||
##[[Cookbook (Chapter 5)#Introduction|Introduction]] | |||
##[[Cookbook (Chapter 5)#Creating a Reset|Creating a Reset]] | |||
##[[Cookbook (Chapter 5)#Kill Tool|Kill Tool]] | |||
##[[Cookbook (Chapter 5)#Key Controls|Key Controls]] | |||
##[[Cookbook (Chapter 5)#Creating a Sword|Creating a Sword]] | |||
##[[Cookbook (Chapter 5)#Creating a Kick Tool|Creating a Kick Tool]] | |||
##[[Cookbook (Chapter 5)#StarterGear|StarterGear]] | |||
#[[Cookbook (Chapter 6)|Service Level]] | |||
##[[Cookbook (Chapter 6)#Introduction|Introduction]] | |||
##[[Cookbook (Chapter 6)#Using GetService|Using GetService]] | |||
##[[Cookbook (Chapter 6)#Getting Server Time|Getting Server Time]] | |||
##[[Cookbook (Chapter 6)#Using Lighting|Using Lighting]] | |||
##[[Cookbook (Chapter 6)#Awarding Badges|Awarding Badges]] | |||
##[[Cookbook (Chapter 6)#Creator Badge|Creator Badge]] | |||
##[[Cookbook (Chapter 6)#Inserting Assets|Inserting Assets]] | |||
##[[Cookbook (Chapter 6)#Retrieving IPs|Retrieving IPs]] | |||
##[[Cookbook (Chapter 6)#Setting Maximum Players|Setting Maximum Players]] | |||
##[[Cookbook (Chapter 6)#Using Debris|Using Debris]] | |||
#[[Cookbook (Chapter 7)|Moving]] | |||
##[[Cookbook (Chapter 7)#Introduction|Introduction]] | |||
##[[Cookbook (Chapter 7)#Moving to a Position|Moving to a Position]] | |||
##[[Cookbook (Chapter 7)#Moving in a Direction|Moving in a Direction]] | |||
##[[Cookbook (Chapter 7)#Rotating in a Direction|Rotating in a Direction]] | |||
##[[Cookbook (Chapter 7)#Using BodyGyro|Using BodyGyro]] | |||
##[[Cookbook (Chapter 7)#Using Dampening|Using Dampening]] | |||
##[[Cookbook (Chapter 7)#Using Power|Using Power]] | |||
##[[Cookbook (Chapter 7)#Using BodyForce|Using BodyForce]] | |||
##[[Cookbook (Chapter 7)#Using BodyThrust|Using BodyThrust]] | |||
##[[Cookbook (Chapter 7)#Simple Welding|Simple Welding]] | |||
##[[Cookbook (Chapter 7)#Weld Offset|Weld Offset]] | |||
##[[Cookbook (Chapter 7)#Simple Motors|Simple Motors]] | |||
##[[Cookbook (Chapter 7)#Motor Speed|Motor Speed]] | |||
##[[Cookbook (Chapter 7)#Joints|Joints]] | |||
#[[Cookbook (Chapter 8)|Miscellaneous]] | |||
##[[Cookbook (Chapter 8)#Local Parts|Local Parts]] | |||
##[[Cookbook (Chapter 8)#Using CameraSubject|Using CameraSubject]] | |||
##[[Cookbook (Chapter 8)#Reflection Metadata|Reflection Metadata]] | |||
##[[Cookbook (Chapter 8)#Testing Chatted Event|Testing Chatted Event]] | |||
[[Cookbook (Chapter 1)|Let's get started!]] | |||
[[Category:Cookbook]] |
Latest revision as of 01:13, 23 February 2012
Author
The entire cookbook was written by Camoy.
Preface
The RBX framework for Lua provides an API for creating 3D games for the ROBLOX game. The API has a vast variety of functionality such as functions for moving in game players to properties controlling custom in game GUIs. The API is easy to use and is quite powerful. This book will cover the basics of the framework and what you will need in order to start programming your own ROBLOX games.
Getting started is easy, just head on over to the download page in order to download the ROBLOX IDE (called Roblox Studio), and the browsing client.
This book assumes a prerequisite knowledge of Lua, however if you do not know Lua at all, don’t turn this book away yet. There are many good resources in learning Lua (one especially helpful resource is here). Even if you have no prior knowledge to Lua, in the early chapters, simple Lua syntax will be explained.
The documentation for the ROBLOX framework can be found at here, at the wiki. Under the “Building and Scripting” category, you will find a link to the “Scripting Reference” and the “Class Reference”. The “Scripting Reference” page is an index of the many scripting articles already written on the wiki site. You may find it useful to check out some of these articles as well. Under the “Class Reference” section, you will find all the ROBLOX objects and will be able to interactively explore their properties, methods, events, and general information. The ROBLOX IDE also has an “Object Browser” (found under Help --> Object Browser), however this is not as comprehensive as the wiki documentation.
In general, this book will provide solutions and examples of many types of problems you may need to solve when building a ROBLOX game. The difficulty level progresses as the book progresses. It is suggested that you read the book cover to back, however if there a certain solution that you need, feel free to jump to it.
Table of Contents
- Basics
- Part Instantiation
- Color and Transparency
- Applying the Touched Event
- Killing Players
- Removing Limbs
- Handling Non-Existent Objects
- Creating a Kill Brick
- Removing Multiple Limbs
- Removing All Character Parts
- Killing All Players
- Killing Random Players on Interval
- Using an Exception Table
- Killing Spawning Characters
- Creating a Message
- Debounce
- Creating a Clickable Part
- Touch Activated Explosion
- Dance Floor
- Creating a Healing Part
- Creating a Restricted Access Door
- Creating an Invisibility Part
- Positioning
- GUI
- Beyond the Basics
- Using BrickColor
- Using Color3
- Using Base Classes
- Using Enumerations
- Event Members
- Disconnecting a Connection
- Using LocalScripts
- Creating a Regeneration Button
- Creating a Template
- Creating a Leaderboard
- Creating a Point Earning Button
- Applying the Chatted Event
- Applying the Changed Event
- Applying the ChildAdded/Removing Event
- Descendants
- Creating a Marquee
- Using a SpecialMesh
- Using a VehicleSeat
- Using Fire
- Tools and HopperBins
- Service Level
- Moving
- Miscellaneous