<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.starfall.wtf/index.php?action=history&amp;feed=atom&amp;title=Scripting</id>
	<title>Scripting - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.starfall.wtf/index.php?action=history&amp;feed=atom&amp;title=Scripting"/>
	<link rel="alternate" type="text/html" href="https://wiki.starfall.wtf/index.php?title=Scripting&amp;action=history"/>
	<updated>2026-07-28T15:21:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.starfall.wtf/index.php?title=Scripting&amp;diff=193&amp;oldid=prev</id>
		<title>PRG at 22:06, 9 December 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.starfall.wtf/index.php?title=Scripting&amp;diff=193&amp;oldid=prev"/>
		<updated>2024-12-09T22:06:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:06, 10 December 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{CatUp|Lua Help}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{CatUp|Lua Help}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, you want to learn how to script? This should be the very first place to look. Be sure to read everything carefully, making sure that you understand what is being read. If you have any questions or comments feel free to ask them either [[Talk:Scripting|on the discussion page]] or on the [http://&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;www&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;roblox.com&lt;/del&gt;/Forum Forum].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, you want to learn how to script? This should be the very first place to look. Be sure to read everything carefully, making sure that you understand what is being read. If you have any questions or comments feel free to ask them either [[Talk:Scripting|on the discussion page]] or on the [http://&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cirkl&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zone&lt;/ins&gt;/Forum&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/Default.aspx &lt;/ins&gt;Forum].  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Introduction==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Introduction==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PRG</name></author>
	</entry>
	<entry>
		<id>https://wiki.starfall.wtf/index.php?title=Scripting&amp;diff=191&amp;oldid=prev</id>
		<title>PRG: Created page with &quot;{{CatUp|Lua Help}}  So, you want to learn how to script? This should be the very first place to look. Be sure to read everything carefully, making sure that you understand what is being read. If you have any questions or comments feel free to ask them either on the discussion page or on the [http://www.roblox.com/Forum Forum].  ==Introduction==  The ROBLOX scripting language is [http://www.lua.org Lua 5.1], a concise and efficient scripting language us...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.starfall.wtf/index.php?title=Scripting&amp;diff=191&amp;oldid=prev"/>
		<updated>2024-12-09T22:04:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{CatUp|Lua Help}}  So, you want to learn how to script? This should be the very first place to look. Be sure to read everything carefully, making sure that you understand what is being read. If you have any questions or comments feel free to ask them either &lt;a href=&quot;/index.php?title=Talk:Scripting&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Talk:Scripting (page does not exist)&quot;&gt;on the discussion page&lt;/a&gt; or on the [http://www.roblox.com/Forum Forum].  ==Introduction==  The ROBLOX scripting language is [http://www.lua.org Lua 5.1], a concise and efficient scripting language us...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{CatUp|Lua Help}}&lt;br /&gt;
&lt;br /&gt;
So, you want to learn how to script? This should be the very first place to look. Be sure to read everything carefully, making sure that you understand what is being read. If you have any questions or comments feel free to ask them either [[Talk:Scripting|on the discussion page]] or on the [http://www.roblox.com/Forum Forum].&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The ROBLOX scripting language is [http://www.lua.org Lua 5.1], a concise and efficient scripting language used in games and embedded systems. Documentation on the language can be found at [http://www.lua.org/docs.html here]. &lt;br /&gt;
&lt;br /&gt;
Scripting requires the [[Script]] object which can control a number of things. For list of Lua objects that can be used, see the [[Class Reference]]. &lt;br /&gt;
&lt;br /&gt;
This article is documentation for people slightly familiar with the language. If you have no idea what you&amp;#039;re doing, you may want to look at these:&lt;br /&gt;
&lt;br /&gt;
*[[Absolute beginner&amp;#039;s guide to scripting]]&lt;br /&gt;
*[[Flowcharts]]&lt;br /&gt;
*[[Reusing code]]&lt;br /&gt;
&lt;br /&gt;
[[Intro to Scripting: Make a Dance Floor]] is a tutorial for beginners that shows how [[Script|scripts]] can be used to control the [[BrickColor (Property)|color]] of [[Part|parts]]. Also, when scripting it is also important to look at the [[Object Browser]]. Keep it open when you&amp;#039;re making scripts in [[Edit|Edit mode]]. It can show where and why you&amp;#039;ve made a mistake.&lt;br /&gt;
&lt;br /&gt;
==Fundamentals==&lt;br /&gt;
&lt;br /&gt;
These are the basics. It is very important to understand these.&lt;br /&gt;
&lt;br /&gt;
===Defining Scripts===&lt;br /&gt;
&lt;br /&gt;
Script objects can be placed under the [[RBX.lua.Workspace (Service)|Workspace]] or under [[Part|parts]], [[Model|models]], [[RBX.lua.StringValue (Object)|values]], etc.&lt;br /&gt;
&lt;br /&gt;
Scripts can also be written and executed in the Command toolbar. To execute a script from the command bar:&lt;br /&gt;
&lt;br /&gt;
#Edit a place in [[Roblox Studio|ROBLOX Studio]].&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
#Select View--&amp;gt;Toolbars--&amp;gt;Command from the menu bar. &lt;br /&gt;
#:&amp;#039;&amp;#039;The Command toolbar will appear at the bottom of the screen.&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
#Select View--&amp;gt;[[Output]] from the menu bar. &lt;br /&gt;
#:&amp;#039;&amp;#039;The Output panel will appear just above the Command toolbar.&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
#In the Command toolbar&amp;#039;s textbox type the following:&lt;br /&gt;
#:&amp;lt;pre&amp;gt;print(&amp;quot;Hello World&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Press the &amp;#039;Enter&amp;#039; key.&lt;br /&gt;
#:&amp;#039;&amp;#039;The text &amp;quot;Hello World&amp;quot; appears in the [[Output|Output window]]&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Script Execution===&lt;br /&gt;
&lt;br /&gt;
Script objects only run under certain conditions:&lt;br /&gt;
&lt;br /&gt;
* Scripts entered in the Command toolbar execute when you press Enter. This only applies if you&amp;#039;re in either edit mode or [[Solo mode]].&lt;br /&gt;
&lt;br /&gt;
* Scripts will run, as said before, if under the [[RBX.lua.Workspace (Service)|Workspace]] or general containers.&lt;br /&gt;
&lt;br /&gt;
* Scripts inside a Tool run when the Tool is activated.&lt;br /&gt;
&lt;br /&gt;
Also, if you want a script to NOT run when the game is started, make sure that under the [[Properties]] for a script, the [[Bool]] &amp;#039;Disabled&amp;#039;, is set to true. A script will also not run if under the [[Lighting]], [[Sound Service]], or any [[Service]] besides the [[RBX.lua.Workspace (Service)|Workspace]]. If the script&amp;#039;s [[Parent (Property)|property]] is under the [[DataModel]], then it will also not run.&lt;br /&gt;
&lt;br /&gt;
===Environments and Libraries===&lt;br /&gt;
&lt;br /&gt;
Each Script has its own copy of the global [http://www.lua.org/manual/5.1/manual.html#2.9  Environment]. This &amp;quot;sandboxes&amp;quot; each script. For instance another script cannot overwrite the global data defined in another script.&lt;br /&gt;
&lt;br /&gt;
ROBLOX loads the following Lua standard libraries: [http://www.lua.org/manual/5.1/manual.html#5.1  Basic Functions], [http://www.lua.org/manual/5.1/manual.html#5.2 Coroutine Manipulation],  [http://www.lua.org/manual/5.1/manual.html#5.4 String Manipulation],  [http://www.lua.org/manual/5.1/manual.html#5.5 Table Manipulation],  [http://www.lua.org/manual/5.1/manual.html#5.6 Mathematical Functions]. For security purposes some functions have been removed to deny access to system resources. A list of these functions can be found in the [[Function Dump]] page of the wiki. In addition, some [http://wiki.roblox.com/index.php?title=Category:ROBLOX_Lua_Objects Roblox Lua Objects] have been removed for the very same reason.&lt;br /&gt;
&lt;br /&gt;
===Math===&lt;br /&gt;
&lt;br /&gt;
One important feature that nearly all programming languages use is math. Here&amp;#039;s what you need to know:&lt;br /&gt;
&lt;br /&gt;
*You can use the [[Output]] to view your solutions. You can use other types of output too, like [[RBX.lua.Message (Object)|messages]] and [[RBX.lua.Hint (Object)|hints]].&lt;br /&gt;
*Roblox can perform complex probelms for you.&lt;br /&gt;
*This can make things extremely simple.&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s a sample of basic math. Open up [[Roblox Studio]], goto File&amp;gt; New, insert a [[Script]] into the [[RBX.lua.Workspace (Service)|Workspace]], make sure that the [[Output]] is open. &lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a = 1 + 1 --&amp;#039;a&amp;#039; represents your math problem.&lt;br /&gt;
print(a) --This prints the result.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a = 5*5+1&lt;br /&gt;
print(a) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a = (9*9) + 19&lt;br /&gt;
print(a)&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For more information, and usage, read the following articles:&lt;br /&gt;
&lt;br /&gt;
*[[Basic math]]&lt;br /&gt;
*[[Variables]]&lt;br /&gt;
*[[Conditional statements]]&lt;br /&gt;
*[[Random numbers]]&lt;br /&gt;
*[[How To Increase and Decrease Vector3 Values]]&lt;br /&gt;
&lt;br /&gt;
==Data Model==&lt;br /&gt;
&amp;lt;i&amp;gt;The [[DataModel]] is what you would define as &amp;#039;game&amp;#039; in your scripts.&amp;lt;/i&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Here are Lua &amp;#039;types&amp;#039; that can be used in a script&lt;br /&gt;
&lt;br /&gt;
===Basic Types===&lt;br /&gt;
&lt;br /&gt;
ROBLOX scripts use the basic [http://www.lua.org/manual/5.1/manual.html#2.2 Lua types] &amp;#039;&amp;#039;[[nil]], [[Bool|boolean]], number, [[string]], function, userdata, [[thread]], and [[Tables|table]]&amp;#039;&amp;#039;. In addition, there are the following additional basic types:&lt;br /&gt;
&lt;br /&gt;
====Vector3====&lt;br /&gt;
&lt;br /&gt;
[[Vector3]] represents a 3D vector. All [[properties]] are [[Read-Only]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Property !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; || number ||| the x-coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; || number ||| the y-coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; || number ||| the z-coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;unit&amp;lt;/code&amp;gt; || Vector3 ||| a normalized copy of the vector&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;magnitude&amp;lt;/code&amp;gt;|| number ||| the length of the vector&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Member Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Vector3 lerp(Vector3 goal, number alpha)&amp;lt;/code&amp;gt; || returns a Vector3 lerped between this Vector3 and the goal. alpha should be between 0 and 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====CFrame====&lt;br /&gt;
&lt;br /&gt;
[[CFrame]], know as character frame, but more specifically coordinate frame.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Constructor !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;new()&amp;lt;/code&amp;gt; || Creates an identity CFrame&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;new(v)&amp;lt;/code&amp;gt; || Creates CFrame from offset Vector3 v&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;new(v, l)&amp;lt;/code&amp;gt; || Creates CFrame from offset Vector3 v looking at point l&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;new(x, y, z)&amp;lt;/code&amp;gt; || Creates CFrame from offset (x, y, z)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;new(x, y, z, qx, qy, qz, qw)&amp;lt;/code&amp;gt; || Creates CFrame from offset (x, y, z) and quaternion (qx, qy, qz, qw)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;new(x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22)&amp;lt;/code&amp;gt; || Creates CFrame from offset (x, y, z) and rotation matrix (R00, R01, R02, R10, R11, R12, R20, R21, R22)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;fromEulerAnglesXYZ(x, y, z)&amp;lt;/code&amp;gt; || Creates a rotated CFrame (x, y, z) in radians&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;fromAxisAngle(v, r)&amp;lt;/code&amp;gt; || Creates a rotated CFrame from a unit vector and a rotation in [http://en.wikipedia.org/wiki/Radian radians]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Property !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; || Vector3 ||| the translation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; || number ||| the x-component of translation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; || number ||| the y-component of translation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; || number ||| the z-component of translation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;lookVector&amp;lt;/code&amp;gt; || Vector3 ||| returns the facing direction along each axis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Member Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CFrame inverse()&amp;lt;/code&amp;gt; || returns the inverse of this CFrame&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CFrame toWorldSpace(CFrame)&amp;lt;/code&amp;gt; || returns a CFrame transformed from Object to World coordinates. Also works with tuples&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CFrame toObjectSpace(CFrame)&amp;lt;/code&amp;gt; || returns a CFrame transformed from World to Object coordinates. Also works with tuples&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Vector3 pointToWorldSpace(Vector3)&amp;lt;/code&amp;gt; || returns a Vector3 transformed from Object to World coordinates. Also works with tuples&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Vector3 pointToObjectSpace(Vector3)&amp;lt;/code&amp;gt; || returns a Vector3 transformed from World to Object coordinates. Also works with tuples&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Vector3 vectorToWorldSpace(Vector3)&amp;lt;/code&amp;gt; || returns a Vector3 rotated from Object to World coordinates. Also works with tuples&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Vector3 vectorToObjectSpace(Vector3)&amp;lt;/code&amp;gt; || returns a Vector3 rotated from World to Object coordinates. Also works with tuples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Operator !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CFrame * CFrame&amp;lt;/code&amp;gt; || returns composition of two CFrames&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CFrame * Vector3&amp;lt;/code&amp;gt; || returns Vector3 transformed from Object to World coordinates&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CFrame + Vector3&amp;lt;/code&amp;gt; || returns CFrame translated by Vector3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CFrame - Vector3&amp;lt;/code&amp;gt; || returns CFrame translated by -Vector3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Color3====&lt;br /&gt;
&lt;br /&gt;
[[Color3]], sets color likely in [http://en.wikipedia.org/wiki/Hexadecimal Hex] format (e.g. 1, 255, 98).&lt;br /&gt;
&lt;br /&gt;
====BrickColor====&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Function!! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; || BrickColor ||| returns a BrickColor (from a number, string, Color3 or r-g-b values)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Random&amp;lt;/code&amp;gt; || BrickColor ||| returns a random BrickColor &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;White&amp;lt;/code&amp;gt; || BrickColor ||| returns White&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Gray&amp;lt;/code&amp;gt; || BrickColor ||| returns Gray&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DarkGray&amp;lt;/code&amp;gt; || BrickColor ||| returns Dark Gray&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Black&amp;lt;/code&amp;gt; || BrickColor ||| returns Black&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Red&amp;lt;/code&amp;gt; || BrickColor ||| returns Red&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Yellow&amp;lt;/code&amp;gt; || BrickColor ||| returns Yellow&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Green&amp;lt;/code&amp;gt; || BrickColor ||| returns Green&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Blue&amp;lt;/code&amp;gt; || BrickColor ||| returns Blue&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Property !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Number&amp;lt;/code&amp;gt; || number ||| The unique number that identifies the BrickColor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Name&amp;lt;/code&amp;gt; || string ||| the name associated with the BrickColor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Color&amp;lt;/code&amp;gt; || Color3 ||| the Color3 associated with the BrickColor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; || number ||| the red component (between 0 and 1)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; || number ||| the green component (between 0 and 1)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; || number ||| the blue component (between 0 and 1)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
local b = BrickColor.Yellow()&lt;br /&gt;
&amp;lt;br&amp;gt;print(b.r)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
prints: 0.96078437566757&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;BrickColor Codes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[image:RobloxColors.PNG]]&lt;br /&gt;
[+] Use SirGelatina&amp;#039;s [[Color Reference]]&lt;br /&gt;
&lt;br /&gt;
{{Example|1=&amp;lt;i&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- Set myPart color to red.&lt;br /&gt;
myPart.BrickColor = BrickColor.new(21)&lt;br /&gt;
&lt;br /&gt;
-- Note that this is equivalent to:&lt;br /&gt;
myPart.Color = Color.new(1,0,0)&lt;br /&gt;
&lt;br /&gt;
-- Which is also equivalent to:&lt;br /&gt;
myPart.BrickColor = BrickColor.new(&amp;quot;Bright red&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- But only certain colors can be used like this:&lt;br /&gt;
myPart.BrickColor = BrickColor.Red()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Connection====&lt;br /&gt;
Represents a connection to an [[#Events|Event]]&lt;br /&gt;
;&lt;br /&gt;
&lt;br /&gt;
===Globals===&lt;br /&gt;
In addition to loading several [[Environments and Libraries|Standard Libraries]] ROBLOX defines the following global variables:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;game&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the DataModel object that is the root of the tree for a Place.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;workspace&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the Workspace object that is a child of the DataModel.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the Script object that defines the script.  (not applicable for the Command toolbar)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; echoes each argument to the Output panel.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;time()&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; returns returns the current game time in seconds.  (NOTE: THis function is scheduled for an upcoming release)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;wait(t)&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; yields the current thread after &amp;quot;t&amp;quot; seconds have elapsed.  If t is not specified, then it yields for a very short period of time. The function returns 2 values:  The elapsed time and the current game time.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;delay(t,f)&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; executes function &amp;quot;f&amp;quot; after &amp;quot;t&amp;quot; seconds have elapse. The function &amp;quot;f&amp;quot; is called with 2 arguments:  The elapsed time and the current game time.&lt;br /&gt;
&lt;br /&gt;
===Roblox Objects===&lt;br /&gt;
&amp;lt;i&amp;gt;See Main List: [http://wiki.roblox.com/index.php?title=Category:ROBLOX_Lua_Objects RBX.lua Objects]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each object in the [[Explorer]] is accessible with scripting. ROBLOX Objects have [[Properties]], [[Functions]] and [[Scripting#Events|Events]]. You can browse the member definitions by clicking [[Class Explorer]] under the Help menu.&lt;br /&gt;
&lt;br /&gt;
====Properties====&lt;br /&gt;
Object properties are accessed with the “dot” notation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;script.Name = &amp;quot;Hello&amp;quot;&lt;br /&gt;
print(script.Name)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some properties are [[Read-Only]]. Attempting to assign to a read-only property will throw an [http://www.lua.org/manual/5.1/manual.html#pdf-error error].&lt;br /&gt;
&lt;br /&gt;
====Functions====&lt;br /&gt;
Member functions are called using the [http://www.lua.org/manual/5.1/manual.html#2.5.9| &amp;quot;colon&amp;quot; operator]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;copy = script:clone()&lt;br /&gt;
print(copy.Name)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functions in Lua are first-class objects. Therefore you can reference a member function as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;f = script.clone&lt;br /&gt;
copy = f(script)&lt;br /&gt;
print(copy.Name)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: solid #aaa 1px; background: #f9f9f9; padding: 4px; text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; If you are used to other scripting languages you will need remember to use &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; when invoking a member function. &amp;lt;code&amp;gt;script.clone()&amp;lt;/code&amp;gt; will not behave as you might expect.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Events====&lt;br /&gt;
Events are fired by Objects. Scripts define code to be executed when an event is fired. Events can optionally send one or more arguments when fired. &lt;br /&gt;
&lt;br /&gt;
There are two ways to handle an Event:&lt;br /&gt;
&lt;br /&gt;
# When a script calls &amp;lt;code&amp;gt;wait()&amp;lt;/code&amp;gt;, the currently executing thread yields until the Event is fired. The return values from &amp;lt;code&amp;gt;wait()&amp;lt;/code&amp;gt; are the Event arguments.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# A script calls &amp;lt;code&amp;gt;connect()&amp;lt;/code&amp;gt; passing in a function that the Event will call each time the Event is fired. &amp;lt;code&amp;gt;connect()&amp;lt;/code&amp;gt; immediately returns a Connection object that can be used to disconnect the listener function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is some sample code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- Get the Script&amp;#039;s Parent object&lt;br /&gt;
part = script.Parent&lt;br /&gt;
&lt;br /&gt;
-- Define a handler for the &amp;quot;Touched&amp;quot; Event&lt;br /&gt;
function onTouched(otherPart)&lt;br /&gt;
print(otherPart.Name .. &amp;quot; touched me!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Listen for each time that &amp;quot;part&amp;quot; is touched&lt;br /&gt;
connection = part.Touched:connect(onTouched)&lt;br /&gt;
&lt;br /&gt;
-- Put this thread to sleep until a property changes&lt;br /&gt;
propName = part.Changed:wait()&lt;br /&gt;
print(&amp;quot;Property changed: &amp;quot; .. propName)&lt;br /&gt;
-- Stop listening to the Touched event&lt;br /&gt;
connection:disconnect()&amp;lt;/pre&amp;gt;&lt;br /&gt;
This code listens for two events: The Part being touched and also for a &amp;#039;&amp;#039;Changed&amp;#039;&amp;#039; event. Since we connected to the Touched event, the function &amp;lt;code/&amp;gt;onTouched()&amp;lt;/code&amp;gt; will be called each time Part is touched. However, once the &amp;#039;&amp;#039;Changed&amp;#039;&amp;#039; Event fires and the &amp;lt;code&amp;gt;wait()&amp;lt;/code&amp;gt;&lt;br /&gt;
call returns, we won&amp;#039;t listen for another &amp;#039;&amp;#039;Changed&amp;#039;&amp;#039; event. At that point we also disconnect from the &amp;#039;&amp;#039;Touched&amp;#039;&amp;#039; event.&lt;br /&gt;
&lt;br /&gt;
You are not strictly required to disconnect every connection you make. If the Object owning the Event is collected, then the listening script will no longer get events. Similarly, if the Script Object that owns the listener is removed, then the connection is automatically broken, and any waiting threads can be collected.&lt;br /&gt;
&lt;br /&gt;
== Object Types ==&lt;br /&gt;
There are many different object types in Roblox, and in addition to adding them through the Roblox Studio, you can also define a new object in a script with the line Instance.new(&amp;quot;className&amp;quot;), with className being the object&amp;#039;s type. Following is a listing of many of the various object types.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Common Mistakes==&lt;br /&gt;
&lt;br /&gt;
The slightest misspelling, or even incorrect capitalization will result in your script failing to work. REMEMBER: Look at the [[Output]] to check for errors. If this doesn&amp;#039;t help, back-track and make sure everything is perfect. If you think there is a problem, or you need help in general, report the problem to the [[Bugs]] article, and request help [http://www.roblox.com/Forum on the Forum.] For more help, see the &amp;#039;See Also&amp;#039; section at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;In the beginning:...&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[[Your first script]]&lt;br /&gt;
*[[Basic Scripting]]&lt;br /&gt;
*[[Explaining Scripts]]&lt;br /&gt;
*[[Loops]]&lt;br /&gt;
*[[How To Increase and Decrease Vector3 Values]]&lt;br /&gt;
*[[In-Depth Scripting Guide]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Scripting [[Tutorials]] and Articles:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[[Commands]]&lt;br /&gt;
*[[Intro to Scripting: Make a Healing Potion]]&lt;br /&gt;
*[[In-Depth Scripting Guide]]&lt;br /&gt;
*[[Intro to Scripting: Make an Invisibility Tool]]&lt;br /&gt;
*[[Teleportation]]&lt;br /&gt;
*[[How to make lava]]&lt;br /&gt;
*[[How to Make Weapon Giving Teleporters]]&lt;br /&gt;
*[[How Do I Make Morphs?]]&lt;br /&gt;
*[[How to Create a Black Hole]] &lt;br /&gt;
*[[How to Make Conveyor Belts]] &lt;br /&gt;
*[[How to Make a Plane]] &lt;br /&gt;
*[[How to make circles]] &lt;br /&gt;
*[[How to make a spiral staircase]] &lt;br /&gt;
*[[How to make a double helix]]&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;b&amp;gt;General Information:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[[Random numbers]]&lt;br /&gt;
*[[Commands]] &lt;br /&gt;
*[[Conditional statements]] &lt;br /&gt;
*[[Variables]]&lt;br /&gt;
*[[Flowcharts]]&lt;br /&gt;
*[[Generic for]] &lt;br /&gt;
*[[Bool]] &lt;br /&gt;
*[[String]] &lt;br /&gt;
*[[Flowcharts]]&lt;br /&gt;
*[[Linked lists]]&lt;br /&gt;
*[[Functions]]&lt;br /&gt;
*[[Tables]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Support:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[[Request Lua Feature]]&lt;br /&gt;
*[[Bugs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;br /&gt;
[[Category:Reference Pages]]&lt;/div&gt;</summary>
		<author><name>PRG</name></author>
	</entry>
</feed>