<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.figuramc.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Slyme</id>
	<title>FiguraMC - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.figuramc.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Slyme"/>
	<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php/Special:Contributions/Slyme"/>
	<updated>2026-05-29T17:04:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics&amp;diff=748</id>
		<title>User:Slyme/Drafts/Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics&amp;diff=748"/>
		<updated>2024-11-04T03:31:04Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is &#039;&#039;heavily&#039;&#039; unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;For the time being, please visit the real [[Lua Basics]] page.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Notice&lt;br /&gt;
|content=&#039;&#039;&#039;This document only goes over the syntax of Lua.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* For more specific documents (such as ones going over variables, functions, etc.), please scroll to the bottom of the page or [[#See more|click here]].&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics/Values&amp;diff=747</id>
		<title>User:Slyme/Drafts/Lua Basics/Values</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics/Values&amp;diff=747"/>
		<updated>2024-11-04T03:30:59Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Created page with &amp;quot;{{Notice |content=&amp;#039;&amp;#039;&amp;#039;This article is part of a larger series on the Lua Basics.&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt; * Please check out the Lua Basics if you haven&amp;#039;t already. * For more documents within this series, please scroll to the bottom of the page or click here. }} &amp;#039;&amp;#039;&amp;#039;Values&amp;#039;&amp;#039;&amp;#039; are essentially data within Lua. Values can be passed into functions as arguments and can be stored in variables for future use.  There are several different ty...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice&lt;br /&gt;
|content=&#039;&#039;&#039;This article is part of a larger series on the [[../|Lua Basics]].&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Please check out the [[Lua Basics]] if you haven&#039;t already.&lt;br /&gt;
* For more documents within this series, please scroll to the bottom of the page or [[#See more|click here]].&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;&#039;Values&#039;&#039;&#039; are essentially data within Lua. Values can be passed into [[#Functions|functions]] as arguments and can be stored in [[../Variables|variables]] for future use.&lt;br /&gt;
&lt;br /&gt;
There are several different types of data within Lua. We&#039;ll go over some of the more basic ones below.&lt;br /&gt;
== {{Type|boolean}} ==&lt;br /&gt;
Booleans store either a {{Type|true}} or {{Type|false}} value, nothing else. They can be operated on with [[../Operators#Logical_Operators|logical operators]] such as &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt;.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=local a = true&lt;br /&gt;
local b = false&lt;br /&gt;
&lt;br /&gt;
print(a and b) --&amp;gt; false&lt;br /&gt;
print(a or b) --&amp;gt; true&lt;br /&gt;
print(not a) --&amp;gt; false&lt;br /&gt;
print(a and not b) --&amp;gt; true&lt;br /&gt;
}}&lt;br /&gt;
== {{Type|number}} ==&lt;br /&gt;
Numbers store any numeric value, including {{Type|integers}} and {{Type|floats}}. Numbers are primarily operated on using [[../Operators#Arithmetic_Operators|arithmetic]] (&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt;, etc.) and [[../Operators#Relational_Operators|relational]] (&amp;lt;code&amp;gt;==&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;=&amp;lt;/code&amp;gt;, etc.) operators.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=local a = 3&lt;br /&gt;
local b = 5.5&lt;br /&gt;
local c = 9&lt;br /&gt;
&lt;br /&gt;
print(a + b) --&amp;gt; 7.5&lt;br /&gt;
print(b * c) --&amp;gt; 49.5&lt;br /&gt;
print(c / a) --&amp;gt; 3&lt;br /&gt;
}}&lt;br /&gt;
== {{Type|string}} ==&lt;br /&gt;
Strings are sequences of characters usually made to form human-readable text. They can be created by wrapping characters within quotes (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) or apostrophes/single quotes (&amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The character used to wrap the string, either &amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;, cannot be normally used within the string without a syntax error. These characters can be escaped by putting a backslash (&amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt;) behind them to use them as normal. Newlines are similar, however they are escaped by using &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Literal strings, wrapped using double brackets (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[example]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;), automatically escape all characters within, including newlines. This means that literal strings can go over multiple lines, be represented as such in the value, and still not cause a syntax error.&lt;br /&gt;
&lt;br /&gt;
Strings can be manipulated using the string library, accessed either by using the &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; global variable or by using the methods of a string object.&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics&amp;diff=564</id>
		<title>User:Slyme/Drafts/Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics&amp;diff=564"/>
		<updated>2024-10-07T03:29:31Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Removed redirect to User:Slyme/Discards/Lua Basics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is &#039;&#039;heavily&#039;&#039; unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;For the time being, please visit the real [[Lua Basics]] page.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Discards/Lua_Basics&amp;diff=563</id>
		<title>User:Slyme/Discards/Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Discards/Lua_Basics&amp;diff=563"/>
		<updated>2024-10-07T03:29:22Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
|content=&#039;&#039;&#039;This page has been discarded.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
No more work will be done on this page.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==The Interpreter==&lt;br /&gt;
The interpreter is just the thing that runs your Lua code. In Figura&#039;s case, it&#039;s a [https://github.com/FiguraMC/luaj/ custom version of LuaJ], an interpreter written in Java.&lt;br /&gt;
&lt;br /&gt;
A Lua interpreter reads each line sequentially, executing each line before moving on to the next one. This makes it hard to break away from the sequence without breaking the program entirely for something like a sleep call.&lt;br /&gt;
==Comments==&lt;br /&gt;
Comments are used to tell the interpreter to ignore a part of the code, either because it&#039;s for human programmers to see or it&#039;s a piece of code that should not be executed.&lt;br /&gt;
&lt;br /&gt;
Short comments, comments that only affect one line, start with &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;. From the two dashes to the end of the line, code will be ignored.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=--This is a comment.&lt;br /&gt;
local x = 2 -- Everything after the two dashes will be ignored.&lt;br /&gt;
-- local y = 3 -- The preceding code will not run because it&#039;s part of a comment.&lt;br /&gt;
-- This is useful in case you need to document your code for future programmers or you need to stop code from running without removing it from the script.&lt;br /&gt;
}}&lt;br /&gt;
===Long Comments===&lt;br /&gt;
Long comments, comments that can go over multiple lines, come in the form of &amp;lt;code&amp;gt;--[[ ]]&amp;lt;/code&amp;gt;. Everything between the two brackets is commented and, thus, ignored by the interpreter.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=--[[&lt;br /&gt;
  This is a block comment. None of the&lt;br /&gt;
  lines within the comment will be executed&lt;br /&gt;
  until the final bracket.&lt;br /&gt;
--]] -- Sometimes programmers will put two dashes before the end of block comments. This is not required but looks nice.&lt;br /&gt;
local z = 5 -- You can use both types of comments within the same script.&lt;br /&gt;
--[[&lt;br /&gt;
  Block comments are useful for long&lt;br /&gt;
  explanations of code or for ignoring&lt;br /&gt;
  large swaths of code.&lt;br /&gt;
  ]]&lt;br /&gt;
}}&lt;br /&gt;
==Variables==&lt;br /&gt;
Think of variables as a bunch of boxes. Each variable is one box, a label printed on it with an object (or, in some cases, a few) stored inside.&lt;br /&gt;
&lt;br /&gt;
To put something inside a variable, you&#039;ll want to set it equal to that something. For example...&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a = 247 -- Make a new local variable &amp;quot;a&amp;quot; and set  the value within to be the number 247.&lt;br /&gt;
local b = &amp;quot;Hello, World!&amp;quot; -- Make a new local variable &amp;quot;b&amp;quot; and set the value within to be the string &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
c = 10 -- Make a new *global* variable &amp;quot;c&amp;quot; and set the value within to be the number 10.&lt;br /&gt;
}}&lt;br /&gt;
The last variable, &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;, is a global variable. This means that it can be used &#039;&#039;anywhere&#039;&#039; within the Lua environment. While this may seem like a good thing at first, there are many cases where this may not be a thing you want. For example, let&#039;s see how a system like below, assuming each script is run in sequence in the same environment, would fare with global variables&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 1&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-1.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 2&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-2.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 3&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-3.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(require(&amp;quot;test-script-1&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
print(require(&amp;quot;test-script-2&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
print(require(&amp;quot;test-script-3&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
 |name=script-checker.lua&lt;br /&gt;
}}&lt;br /&gt;
We&#039;ll get more into variable scopes later. Watch out for all other instances of &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; throughout the rest of the document, it may interfere with other scripts. ;)&lt;br /&gt;
=== Valid Names ===&lt;br /&gt;
Variable names...&lt;br /&gt;
* Can only use alphanumeric characters and &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;&lt;br /&gt;
* Must not start with a number.&lt;br /&gt;
* Cannot be the same as a Lua keyword (&amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt;, etc.)&lt;br /&gt;
For instance...&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a -- ✅ Valid&lt;br /&gt;
local _b -- ✅ Valid&lt;br /&gt;
local aBc123 -- ✅ Valid&lt;br /&gt;
local 123abc -- ❌ Invalid; Variable names cannot start with a number.&lt;br /&gt;
local foo-bar -- ❌ Invalid; Variable names can only use alphanumeric characters.&lt;br /&gt;
local and -- ❌ Invalid; Variable names cannot be the same as a Lua keyword.&lt;br /&gt;
local local -- ❌ Invalid; Variable names cannot be the same as a Lua keyword.&lt;br /&gt;
}}&lt;br /&gt;
=== Declaring Without Setting ===&lt;br /&gt;
In some cases, you may want to declare a local variable without setting its value. This can be done by just writing &amp;lt;code&amp;gt;local variableName&amp;lt;/code&amp;gt; without adding a &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a -- a is now initialized as a local variable with no value.&lt;br /&gt;
print(a) --&amp;gt; nil&lt;br /&gt;
a = 3 -- Variables already declared as locals do not need to be marked as local again.&lt;br /&gt;
print(a) --&amp;gt; 3&lt;br /&gt;
}}&lt;br /&gt;
==Types==&lt;br /&gt;
A type is any sort of object, whether it be a few words, a number, a true/false value, etc.&lt;br /&gt;
==={{Type|boolean}}===&lt;br /&gt;
Booleans hold one of two values: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These are typically returned when a relational operator (&amp;lt;code&amp;gt;==&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;=&amp;lt;/code&amp;gt;, etc.) or a boolean operator (&amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, etc.) is used.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(true) --&amp;gt; true&lt;br /&gt;
print(5 &amp;gt; 3) --&amp;gt; true&lt;br /&gt;
print(10 &amp;lt;= 6) --&amp;gt; false&lt;br /&gt;
print(true and false) --&amp;gt; false&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|number}}===&lt;br /&gt;
Numbers are numbers, either integer or decimal.&lt;br /&gt;
&lt;br /&gt;
Numbers are typically returned when an arithmetic operator (&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, etc.) is used.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(5) --&amp;gt; 5&lt;br /&gt;
print(5 + 2) --&amp;gt; 7&lt;br /&gt;
print(5 * 2) --&amp;gt; 10&lt;br /&gt;
print(5 / 2) --&amp;gt; 2.5&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|string}}===&lt;br /&gt;
Strings are sequences of characters, most notably text. When defined in code, strings must be wrapped in either quotes (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) or single quotes (&amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Strings can be modified using the [https://www.lua.org/manual/5.2/manual.html#6.4 String standard library], accessible using either the &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; global or by using the methods on strings themselves.&lt;br /&gt;
&lt;br /&gt;
When defining a string in code, make sure to use &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt; in place of linebreaks within the string. Using real line breaks instead of &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt; will result in a syntax error.&lt;br /&gt;
&lt;br /&gt;
You may also need to escape single/double quotes in case the character you want to use is already used to wrap the string. In that case, just put a backslash (&amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt;) in front of the character to escape it (for example, &amp;lt;code&amp;gt;&amp;quot;\&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; is the same as &amp;lt;code&amp;gt;&#039;&amp;quot;&#039;&amp;lt;/code&amp;gt;). &lt;br /&gt;
====Literal Strings====&lt;br /&gt;
Strings, when surrounded by double brackets (&amp;lt;code&amp;gt;[[]]&amp;lt;/code&amp;gt;), take characters at face value. These are called literal strings and can be used to make a string span multiple lines.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=print(&amp;quot;Hello, World!&amp;quot;) --&amp;gt; Hello, World!&lt;br /&gt;
print(&amp;quot;\&amp;quot;Line 1\&amp;quot;&lt;br /&gt;
&#039;Line 2&#039;&amp;quot;) -- ERROR! unfinished string near &#039;&amp;quot;&amp;quot;Line 1&amp;quot;&#039;&lt;br /&gt;
print(&amp;quot;\&amp;quot;Line 1\&amp;quot;\n&#039;Line 2&#039;&amp;quot;) --&amp;gt; &amp;quot;Line 1&amp;quot;&lt;br /&gt;
                              --  &#039;Line 2&#039;&lt;br /&gt;
print([[&amp;quot;Line 1&amp;quot;&lt;br /&gt;
&#039;Line 2&#039;]]) --&amp;gt; &amp;quot;Line 1&amp;quot;&lt;br /&gt;
            --  &#039;Line 2&#039;&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|nil}}===&lt;br /&gt;
Unlike other types, {{Type|nil}} is the &#039;&#039;absence&#039;&#039; of a value. This is what&#039;s returned when you try to use a variable not defined yet.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=print(a) --&amp;gt; nil&lt;br /&gt;
print(b) --&amp;gt; nil&lt;br /&gt;
print(c) --&amp;gt; 10&lt;br /&gt;
-- Oh, there&#039;s our lovely little global &amp;quot;c&amp;quot; again! Didn&#039;t expect that, did you?&lt;br /&gt;
}}&lt;br /&gt;
Scripts can at best return/display unwanted values and at worst error if a {{Type|nil}} pops up where it shouldn&#039;t.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=string = nil&lt;br /&gt;
local a = &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
print(string.sub(a, 2, 5)) -- ERROR! attempt to index a nil value (global &#039;string&#039;)}}&lt;br /&gt;
==={{Type|table}}===&lt;br /&gt;
Tables are where things start to get more complex. Instead of containing &#039;&#039;one&#039;&#039; object, tables can store &#039;&#039;many&#039;&#039; objects in multiple different ways.&lt;br /&gt;
&lt;br /&gt;
For instance, a table can store a sequence of objects. This is commonly called an array. Arrays start at an index of one and continue counting up for each item added to the table.&lt;br /&gt;
&lt;br /&gt;
However, you don&#039;t &#039;&#039;just&#039;&#039; have to use numbers as indices. You can use any basic object (boolean, number, string, nil) you want! Doing so makes what&#039;s commonly called a dictionary, the indices called keys and the values called values.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=local a = {&amp;quot;Hello,&amp;quot;, &amp;quot;World!&amp;quot;}&lt;br /&gt;
print(a[1]) --&amp;gt; Hello,&lt;br /&gt;
a[&amp;quot;diamond&amp;quot;] = true&lt;br /&gt;
print(a.diamond) --&amp;gt; true -- Doing something like a.diamond is the same as doing a[&amp;quot;diamond&amp;quot;]&lt;br /&gt;
local b = {&lt;br /&gt;
    [c] = true, -- I hope you remember what c is!&lt;br /&gt;
    [true] = 56,&lt;br /&gt;
    [5&amp;lt;3] = b or c -- Expressions can be used as keys and/or values. In this case, (5&amp;lt;3) comes out to true and (c and d) comes out to 10 since d is nil and global c is still 10.&lt;br /&gt;
    [&amp;quot;foo&amp;quot;] = &amp;quot;bar&amp;quot;&lt;br /&gt;
    xyz = &amp;quot;abc&amp;quot; -- String keys can be removed from their brackets and quotes as long as they follow the variable name rules above.&lt;br /&gt;
}&lt;br /&gt;
print(b[b.foo == &amp;quot;bar&amp;quot;]) --&amp;gt; 56 -- Expressions can also be used to index a table.&lt;br /&gt;
}}&lt;br /&gt;
Sometimes, you may want to go over all items within a table. This can be done with a [[#Loops|for loop]].&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics/Variables&amp;diff=562</id>
		<title>User:Slyme/Drafts/Lua Basics/Variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics/Variables&amp;diff=562"/>
		<updated>2024-10-07T03:28:06Z</updated>

		<summary type="html">&lt;p&gt;Slyme: First- nope, Second Draft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice&lt;br /&gt;
|content=&#039;&#039;&#039;This article is part of a larger series on the [[../|Lua Basics]].&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Please check out the [[Lua Basics]] if you haven&#039;t already.&lt;br /&gt;
* For more documents within this series, please scroll to the bottom of the page or [[#See more|click here]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variables&#039;&#039;&#039; are the way Lua stores values for later use. Think of them like several labeled boxes. For our purposes, each box contains one [[../Values|value]]. Whenever you ask for the contents of a specific variable, Lua looks for it, finds it, and reports back with the contents.&lt;br /&gt;
==Declaring a Variable==&lt;br /&gt;
Variables can be made by typing a variable name, an equal sign (&amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;), and a value or expression. They can then be used in place of values and can be modified later within a script.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=a = &amp;quot;Hello, World!&amp;quot; -- Here, we store the string value &amp;quot;Hello, World!&amp;quot; within the variable &amp;quot;a&amp;quot;&lt;br /&gt;
print(a) --&amp;gt; Hello, World!&lt;br /&gt;
a = a .. &amp;quot; You are amazing!&amp;quot; -- We add &amp;quot; You are amazing!&amp;quot; to the end of &amp;quot;Hello, World!&amp;quot; to form...&lt;br /&gt;
print(a) --&amp;gt; Hello, World! You are amazing!&lt;br /&gt;
}}&lt;br /&gt;
Lua is a dynamically typed language, which means that any variable can hold any value regardless of what it originally held.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=a = &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
a = 5&lt;br /&gt;
a = true&lt;br /&gt;
print(a) --&amp;gt; true&lt;br /&gt;
}}&lt;br /&gt;
===Valid Names===&lt;br /&gt;
Variable names...&lt;br /&gt;
* Can only use alphanumeric characters and underscores (&amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Must not start with a number.&lt;br /&gt;
* Cannot be the same as a Lua keyword (&amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt;, etc.)&lt;br /&gt;
For instance...&lt;br /&gt;
* ✅ &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; is a valid variable name.&lt;br /&gt;
* ✅ &amp;lt;code&amp;gt;_b&amp;lt;/code&amp;gt; is a valid variable name.&lt;br /&gt;
* ✅ &amp;lt;code&amp;gt;aBc123&amp;lt;/code&amp;gt; is a valid variable name.&lt;br /&gt;
* ❌ &amp;lt;code&amp;gt;123abc&amp;lt;/code&amp;gt; is an &#039;&#039;&#039;invalid&#039;&#039;&#039; variable name; variable names cannot start with a number.&lt;br /&gt;
* ❌ &amp;lt;code&amp;gt;foo-bar&amp;lt;/code&amp;gt; is an &#039;&#039;&#039;invalid&#039;&#039;&#039; variable name; variable name can only use alphanumeric characters and underscores (&amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;)&lt;br /&gt;
* ❌ &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt; is an &#039;&#039;&#039;invalid&#039;&#039;&#039; variable name; variable names cannot be the same as a Lua keyword.&lt;br /&gt;
* ❌ &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; is an &#039;&#039;&#039;invalid&#039;&#039;&#039; variable name; variable names cannot be the same as a Lua keyword.&lt;br /&gt;
==Issues with Global Variables==&lt;br /&gt;
By default, new variables declared within Lua are global. This means that they can be used &#039;&#039;anywhere&#039;&#039; within the Lua environment once declared. This can lead to some adverse effects.&lt;br /&gt;
&lt;br /&gt;
For starters, scripts can cause interference with other scripts if they all use the same name for a global variable.&lt;br /&gt;
&lt;br /&gt;
These issues can be fixed with [[#Local Variables|local variables]].&lt;br /&gt;
==Local Variables==&lt;br /&gt;
&#039;&#039;&#039;Local variables&#039;&#039;&#039; are limited to their own [[#Variable Scope|scope]], meaning that only instructions within it can access their contents. A new local variable can be created by putting &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; behind the first declaration of the variable.&lt;br /&gt;
&lt;br /&gt;
To use the same local variable within the same scope, make sure to &#039;&#039;&#039;not&#039;&#039;&#039; use the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; tag for the variable again. If not...&lt;br /&gt;
{{Script&lt;br /&gt;
|script=local var = 5&lt;br /&gt;
do&lt;br /&gt;
    print(var) --&amp;gt; 5&lt;br /&gt;
    local var = var*2&lt;br /&gt;
    print(var) --&amp;gt; 10&lt;br /&gt;
end&lt;br /&gt;
print(var) --&amp;gt; 5&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
==Global Variables==&lt;br /&gt;
Global variables are very simple: from the point of its declaration onward, any script in the environment who doesn&#039;t have a local variable with the same name can use the global variable. This can lead to adverse effects.&lt;br /&gt;
&lt;br /&gt;
For one, globals may or may not be defined. If not, trying to use it will result in a {{Type|nil}} being returned instead of a useful value. This may not be what you want in most cases, especially when you intend to use it in an expression, in which case your script will most likely error.&lt;br /&gt;
{{Script&lt;br /&gt;
|name=script-1.lua&lt;br /&gt;
|script=-- ...&lt;br /&gt;
print(c*2) -- ERROR! attempt to perform arithmetic on a nil value (global &#039;c&#039;)&lt;br /&gt;
-- ...&lt;br /&gt;
}}{{Script&lt;br /&gt;
|name=script-2.lua&lt;br /&gt;
|script=-- ...&lt;br /&gt;
c = 10&lt;br /&gt;
-- ...&lt;br /&gt;
}}&lt;br /&gt;
==Local Variables==&lt;br /&gt;
Whenever a local variable is declared, its scope will extend to the end of the block it is currently in. For example...&lt;br /&gt;
{{Script&lt;br /&gt;
|script=local var = 5&lt;br /&gt;
do&lt;br /&gt;
    print(var) --&amp;gt; 5&lt;br /&gt;
    local var = var*2&lt;br /&gt;
    print(var) --&amp;gt; 10&lt;br /&gt;
end&lt;br /&gt;
print(var) --&amp;gt; 5&lt;br /&gt;
|highlight=3-5,7&lt;br /&gt;
}}&lt;br /&gt;
* The first print instruction on line three will print the local variable just outside the &amp;lt;code&amp;gt;do ... end&amp;lt;/code&amp;gt; block since that&#039;s the last time a local variable within its scope was declared with that name.&lt;br /&gt;
* The local variable declaration on line four is able to use the old &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; local variable since the one on line five only overshadows it &#039;&#039;after&#039;&#039; its declaration.&lt;br /&gt;
* The second print instruction on line five will use the newly declared local variable &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; since it&#039;s the closest within its scope.&lt;br /&gt;
* The final print instruction on line seven will use the older local variable &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; since the newer one on line four is now out of scope since it was defined in a block further inside.&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Script&amp;diff=561</id>
		<title>Template:Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Script&amp;diff=561"/>
		<updated>2024-10-07T01:57:51Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Add highlight parameter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;templatestyles src=&amp;quot;Template:Script/style.css&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;scriptbox&amp;quot;&amp;gt;{{#if:{{{name|}}}|&amp;lt;div class=&amp;quot;scriptname&amp;quot;&amp;gt;{{{name}}}&amp;lt;/div&amp;gt;|}}&lt;br /&gt;
{{#tag:syntaxHighlight|{{{1|{{{script}}}}}}&lt;br /&gt;
|lang=&amp;quot;lua&amp;quot;&lt;br /&gt;
|start={{{line}}}&lt;br /&gt;
|line=&lt;br /&gt;
|highlight={{{highlight}}}}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;name&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Script Name&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: false,&lt;br /&gt;
            &amp;quot;description&amp;quot;: &amp;quot;The name of the script, to be shown as a label header.&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;script&amp;quot;: {&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;1&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Script&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;The script to be displayed&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
        &amp;quot;line&amp;quot;: {&lt;br /&gt;
            &amp;quot;label&amp;quot;: &amp;quot;Line Number&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
            &amp;quot;required&amp;quot;: false,&lt;br /&gt;
            &amp;quot;description&amp;quot;: &amp;quot;What number to start counting on.&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        &amp;quot;highlight&amp;quot;: {&lt;br /&gt;
            &amp;quot;label&amp;quot;: &amp;quot;Highlighted Lines&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;,&lt;br /&gt;
            &amp;quot;required&amp;quot;: false,&lt;br /&gt;
            &amp;quot;description&amp;quot;: &amp;quot;Lines to highlight.&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;paramOrder&amp;quot;: [&lt;br /&gt;
		&amp;quot;script&amp;quot;,&lt;br /&gt;
		&amp;quot;name&amp;quot;,&lt;br /&gt;
        &amp;quot;line&amp;quot;,&lt;br /&gt;
        &amp;quot;highlight&amp;quot;&lt;br /&gt;
	]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics&amp;diff=560</id>
		<title>User:Slyme/Drafts/Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Drafts/Lua_Basics&amp;diff=560"/>
		<updated>2024-10-07T01:27:16Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Slyme moved page User:Slyme/Drafts/Lua Basics to User:Slyme/Discards/Lua Basics: Discarded draft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[User:Slyme/Discards/Lua Basics]]&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Discards/Lua_Basics&amp;diff=559</id>
		<title>User:Slyme/Discards/Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Discards/Lua_Basics&amp;diff=559"/>
		<updated>2024-10-07T01:27:16Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Slyme moved page User:Slyme/Drafts/Lua Basics to User:Slyme/Discards/Lua Basics: Discarded draft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is &#039;&#039;heavily&#039;&#039; unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;For the time being, please visit the real [[Lua Basics]] page.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==The Interpreter==&lt;br /&gt;
The interpreter is just the thing that runs your Lua code. In Figura&#039;s case, it&#039;s a [https://github.com/FiguraMC/luaj/ custom version of LuaJ], an interpreter written in Java.&lt;br /&gt;
&lt;br /&gt;
A Lua interpreter reads each line sequentially, executing each line before moving on to the next one. This makes it hard to break away from the sequence without breaking the program entirely for something like a sleep call.&lt;br /&gt;
==Comments==&lt;br /&gt;
Comments are used to tell the interpreter to ignore a part of the code, either because it&#039;s for human programmers to see or it&#039;s a piece of code that should not be executed.&lt;br /&gt;
&lt;br /&gt;
Short comments, comments that only affect one line, start with &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;. From the two dashes to the end of the line, code will be ignored.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=--This is a comment.&lt;br /&gt;
local x = 2 -- Everything after the two dashes will be ignored.&lt;br /&gt;
-- local y = 3 -- The preceding code will not run because it&#039;s part of a comment.&lt;br /&gt;
-- This is useful in case you need to document your code for future programmers or you need to stop code from running without removing it from the script.&lt;br /&gt;
}}&lt;br /&gt;
===Long Comments===&lt;br /&gt;
Long comments, comments that can go over multiple lines, come in the form of &amp;lt;code&amp;gt;--[[ ]]&amp;lt;/code&amp;gt;. Everything between the two brackets is commented and, thus, ignored by the interpreter.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=--[[&lt;br /&gt;
  This is a block comment. None of the&lt;br /&gt;
  lines within the comment will be executed&lt;br /&gt;
  until the final bracket.&lt;br /&gt;
--]] -- Sometimes programmers will put two dashes before the end of block comments. This is not required but looks nice.&lt;br /&gt;
local z = 5 -- You can use both types of comments within the same script.&lt;br /&gt;
--[[&lt;br /&gt;
  Block comments are useful for long&lt;br /&gt;
  explanations of code or for ignoring&lt;br /&gt;
  large swaths of code.&lt;br /&gt;
  ]]&lt;br /&gt;
}}&lt;br /&gt;
==Variables==&lt;br /&gt;
Think of variables as a bunch of boxes. Each variable is one box, a label printed on it with an object (or, in some cases, a few) stored inside.&lt;br /&gt;
&lt;br /&gt;
To put something inside a variable, you&#039;ll want to set it equal to that something. For example...&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a = 247 -- Make a new local variable &amp;quot;a&amp;quot; and set  the value within to be the number 247.&lt;br /&gt;
local b = &amp;quot;Hello, World!&amp;quot; -- Make a new local variable &amp;quot;b&amp;quot; and set the value within to be the string &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
c = 10 -- Make a new *global* variable &amp;quot;c&amp;quot; and set the value within to be the number 10.&lt;br /&gt;
}}&lt;br /&gt;
The last variable, &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;, is a global variable. This means that it can be used &#039;&#039;anywhere&#039;&#039; within the Lua environment. While this may seem like a good thing at first, there are many cases where this may not be a thing you want. For example, let&#039;s see how a system like below, assuming each script is run in sequence in the same environment, would fare with global variables&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 1&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-1.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 2&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-2.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 3&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-3.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(require(&amp;quot;test-script-1&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
print(require(&amp;quot;test-script-2&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
print(require(&amp;quot;test-script-3&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
 |name=script-checker.lua&lt;br /&gt;
}}&lt;br /&gt;
We&#039;ll get more into variable scopes later. Watch out for all other instances of &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; throughout the rest of the document, it may interfere with other scripts. ;)&lt;br /&gt;
=== Valid Names ===&lt;br /&gt;
Variable names...&lt;br /&gt;
* Can only use alphanumeric characters and &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;&lt;br /&gt;
* Must not start with a number.&lt;br /&gt;
* Cannot be the same as a Lua keyword (&amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt;, etc.)&lt;br /&gt;
For instance...&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a -- ✅ Valid&lt;br /&gt;
local _b -- ✅ Valid&lt;br /&gt;
local aBc123 -- ✅ Valid&lt;br /&gt;
local 123abc -- ❌ Invalid; Variable names cannot start with a number.&lt;br /&gt;
local foo-bar -- ❌ Invalid; Variable names can only use alphanumeric characters.&lt;br /&gt;
local and -- ❌ Invalid; Variable names cannot be the same as a Lua keyword.&lt;br /&gt;
local local -- ❌ Invalid; Variable names cannot be the same as a Lua keyword.&lt;br /&gt;
}}&lt;br /&gt;
=== Declaring Without Setting ===&lt;br /&gt;
In some cases, you may want to declare a local variable without setting its value. This can be done by just writing &amp;lt;code&amp;gt;local variableName&amp;lt;/code&amp;gt; without adding a &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a -- a is now initialized as a local variable with no value.&lt;br /&gt;
print(a) --&amp;gt; nil&lt;br /&gt;
a = 3 -- Variables already declared as locals do not need to be marked as local again.&lt;br /&gt;
print(a) --&amp;gt; 3&lt;br /&gt;
}}&lt;br /&gt;
==Types==&lt;br /&gt;
A type is any sort of object, whether it be a few words, a number, a true/false value, etc.&lt;br /&gt;
==={{Type|boolean}}===&lt;br /&gt;
Booleans hold one of two values: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These are typically returned when a relational operator (&amp;lt;code&amp;gt;==&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;=&amp;lt;/code&amp;gt;, etc.) or a boolean operator (&amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, etc.) is used.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(true) --&amp;gt; true&lt;br /&gt;
print(5 &amp;gt; 3) --&amp;gt; true&lt;br /&gt;
print(10 &amp;lt;= 6) --&amp;gt; false&lt;br /&gt;
print(true and false) --&amp;gt; false&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|number}}===&lt;br /&gt;
Numbers are numbers, either integer or decimal.&lt;br /&gt;
&lt;br /&gt;
Numbers are typically returned when an arithmetic operator (&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, etc.) is used.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(5) --&amp;gt; 5&lt;br /&gt;
print(5 + 2) --&amp;gt; 7&lt;br /&gt;
print(5 * 2) --&amp;gt; 10&lt;br /&gt;
print(5 / 2) --&amp;gt; 2.5&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|string}}===&lt;br /&gt;
Strings are sequences of characters, most notably text. When defined in code, strings must be wrapped in either quotes (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) or single quotes (&amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Strings can be modified using the [https://www.lua.org/manual/5.2/manual.html#6.4 String standard library], accessible using either the &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; global or by using the methods on strings themselves.&lt;br /&gt;
&lt;br /&gt;
When defining a string in code, make sure to use &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt; in place of linebreaks within the string. Using real line breaks instead of &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt; will result in a syntax error.&lt;br /&gt;
&lt;br /&gt;
You may also need to escape single/double quotes in case the character you want to use is already used to wrap the string. In that case, just put a backslash (&amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt;) in front of the character to escape it (for example, &amp;lt;code&amp;gt;&amp;quot;\&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; is the same as &amp;lt;code&amp;gt;&#039;&amp;quot;&#039;&amp;lt;/code&amp;gt;). &lt;br /&gt;
====Literal Strings====&lt;br /&gt;
Strings, when surrounded by double brackets (&amp;lt;code&amp;gt;[[]]&amp;lt;/code&amp;gt;), take characters at face value. These are called literal strings and can be used to make a string span multiple lines.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=print(&amp;quot;Hello, World!&amp;quot;) --&amp;gt; Hello, World!&lt;br /&gt;
print(&amp;quot;\&amp;quot;Line 1\&amp;quot;&lt;br /&gt;
&#039;Line 2&#039;&amp;quot;) -- ERROR! unfinished string near &#039;&amp;quot;&amp;quot;Line 1&amp;quot;&#039;&lt;br /&gt;
print(&amp;quot;\&amp;quot;Line 1\&amp;quot;\n&#039;Line 2&#039;&amp;quot;) --&amp;gt; &amp;quot;Line 1&amp;quot;&lt;br /&gt;
                              --  &#039;Line 2&#039;&lt;br /&gt;
print([[&amp;quot;Line 1&amp;quot;&lt;br /&gt;
&#039;Line 2&#039;]]) --&amp;gt; &amp;quot;Line 1&amp;quot;&lt;br /&gt;
            --  &#039;Line 2&#039;&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|nil}}===&lt;br /&gt;
Unlike other types, {{Type|nil}} is the &#039;&#039;absence&#039;&#039; of a value. This is what&#039;s returned when you try to use a variable not defined yet.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=print(a) --&amp;gt; nil&lt;br /&gt;
print(b) --&amp;gt; nil&lt;br /&gt;
print(c) --&amp;gt; 10&lt;br /&gt;
-- Oh, there&#039;s our lovely little global &amp;quot;c&amp;quot; again! Didn&#039;t expect that, did you?&lt;br /&gt;
}}&lt;br /&gt;
Scripts can at best return/display unwanted values and at worst error if a {{Type|nil}} pops up where it shouldn&#039;t.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=string = nil&lt;br /&gt;
local a = &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
print(string.sub(a, 2, 5)) -- ERROR! attempt to index a nil value (global &#039;string&#039;)}}&lt;br /&gt;
==={{Type|table}}===&lt;br /&gt;
Tables are where things start to get more complex. Instead of containing &#039;&#039;one&#039;&#039; object, tables can store &#039;&#039;many&#039;&#039; objects in multiple different ways.&lt;br /&gt;
&lt;br /&gt;
For instance, a table can store a sequence of objects. This is commonly called an array. Arrays start at an index of one and continue counting up for each item added to the table.&lt;br /&gt;
&lt;br /&gt;
However, you don&#039;t &#039;&#039;just&#039;&#039; have to use numbers as indices. You can use any basic object (boolean, number, string, nil) you want! Doing so makes what&#039;s commonly called a dictionary, the indices called keys and the values called values.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=local a = {&amp;quot;Hello,&amp;quot;, &amp;quot;World!&amp;quot;}&lt;br /&gt;
print(a[1]) --&amp;gt; Hello,&lt;br /&gt;
a[&amp;quot;diamond&amp;quot;] = true&lt;br /&gt;
print(a.diamond) --&amp;gt; true -- Doing something like a.diamond is the same as doing a[&amp;quot;diamond&amp;quot;]&lt;br /&gt;
local b = {&lt;br /&gt;
    [c] = true, -- I hope you remember what c is!&lt;br /&gt;
    [true] = 56,&lt;br /&gt;
    [5&amp;lt;3] = b or c -- Expressions can be used as keys and/or values. In this case, (5&amp;lt;3) comes out to true and (c and d) comes out to 10 since d is nil and global c is still 10.&lt;br /&gt;
    [&amp;quot;foo&amp;quot;] = &amp;quot;bar&amp;quot;&lt;br /&gt;
    xyz = &amp;quot;abc&amp;quot; -- String keys can be removed from their brackets and quotes as long as they follow the variable name rules above.&lt;br /&gt;
}&lt;br /&gt;
print(b[b.foo == &amp;quot;bar&amp;quot;]) --&amp;gt; 56 -- Expressions can also be used to index a table.&lt;br /&gt;
}}&lt;br /&gt;
Sometimes, you may want to go over all items within a table. This can be done with a [[#Loops|for loop]].&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Discards/Lua_Basics&amp;diff=558</id>
		<title>User:Slyme/Discards/Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Discards/Lua_Basics&amp;diff=558"/>
		<updated>2024-10-07T01:26:11Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Final edit before discarding.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is &#039;&#039;heavily&#039;&#039; unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;For the time being, please visit the real [[Lua Basics]] page.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==The Interpreter==&lt;br /&gt;
The interpreter is just the thing that runs your Lua code. In Figura&#039;s case, it&#039;s a [https://github.com/FiguraMC/luaj/ custom version of LuaJ], an interpreter written in Java.&lt;br /&gt;
&lt;br /&gt;
A Lua interpreter reads each line sequentially, executing each line before moving on to the next one. This makes it hard to break away from the sequence without breaking the program entirely for something like a sleep call.&lt;br /&gt;
==Comments==&lt;br /&gt;
Comments are used to tell the interpreter to ignore a part of the code, either because it&#039;s for human programmers to see or it&#039;s a piece of code that should not be executed.&lt;br /&gt;
&lt;br /&gt;
Short comments, comments that only affect one line, start with &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;. From the two dashes to the end of the line, code will be ignored.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=--This is a comment.&lt;br /&gt;
local x = 2 -- Everything after the two dashes will be ignored.&lt;br /&gt;
-- local y = 3 -- The preceding code will not run because it&#039;s part of a comment.&lt;br /&gt;
-- This is useful in case you need to document your code for future programmers or you need to stop code from running without removing it from the script.&lt;br /&gt;
}}&lt;br /&gt;
===Long Comments===&lt;br /&gt;
Long comments, comments that can go over multiple lines, come in the form of &amp;lt;code&amp;gt;--[[ ]]&amp;lt;/code&amp;gt;. Everything between the two brackets is commented and, thus, ignored by the interpreter.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=--[[&lt;br /&gt;
  This is a block comment. None of the&lt;br /&gt;
  lines within the comment will be executed&lt;br /&gt;
  until the final bracket.&lt;br /&gt;
--]] -- Sometimes programmers will put two dashes before the end of block comments. This is not required but looks nice.&lt;br /&gt;
local z = 5 -- You can use both types of comments within the same script.&lt;br /&gt;
--[[&lt;br /&gt;
  Block comments are useful for long&lt;br /&gt;
  explanations of code or for ignoring&lt;br /&gt;
  large swaths of code.&lt;br /&gt;
  ]]&lt;br /&gt;
}}&lt;br /&gt;
==Variables==&lt;br /&gt;
Think of variables as a bunch of boxes. Each variable is one box, a label printed on it with an object (or, in some cases, a few) stored inside.&lt;br /&gt;
&lt;br /&gt;
To put something inside a variable, you&#039;ll want to set it equal to that something. For example...&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a = 247 -- Make a new local variable &amp;quot;a&amp;quot; and set  the value within to be the number 247.&lt;br /&gt;
local b = &amp;quot;Hello, World!&amp;quot; -- Make a new local variable &amp;quot;b&amp;quot; and set the value within to be the string &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
c = 10 -- Make a new *global* variable &amp;quot;c&amp;quot; and set the value within to be the number 10.&lt;br /&gt;
}}&lt;br /&gt;
The last variable, &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;, is a global variable. This means that it can be used &#039;&#039;anywhere&#039;&#039; within the Lua environment. While this may seem like a good thing at first, there are many cases where this may not be a thing you want. For example, let&#039;s see how a system like below, assuming each script is run in sequence in the same environment, would fare with global variables&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 1&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-1.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 2&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-2.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 3&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-3.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(require(&amp;quot;test-script-1&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
print(require(&amp;quot;test-script-2&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
print(require(&amp;quot;test-script-3&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
 |name=script-checker.lua&lt;br /&gt;
}}&lt;br /&gt;
We&#039;ll get more into variable scopes later. Watch out for all other instances of &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; throughout the rest of the document, it may interfere with other scripts. ;)&lt;br /&gt;
=== Valid Names ===&lt;br /&gt;
Variable names...&lt;br /&gt;
* Can only use alphanumeric characters and &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;&lt;br /&gt;
* Must not start with a number.&lt;br /&gt;
* Cannot be the same as a Lua keyword (&amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt;, etc.)&lt;br /&gt;
For instance...&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a -- ✅ Valid&lt;br /&gt;
local _b -- ✅ Valid&lt;br /&gt;
local aBc123 -- ✅ Valid&lt;br /&gt;
local 123abc -- ❌ Invalid; Variable names cannot start with a number.&lt;br /&gt;
local foo-bar -- ❌ Invalid; Variable names can only use alphanumeric characters.&lt;br /&gt;
local and -- ❌ Invalid; Variable names cannot be the same as a Lua keyword.&lt;br /&gt;
local local -- ❌ Invalid; Variable names cannot be the same as a Lua keyword.&lt;br /&gt;
}}&lt;br /&gt;
=== Declaring Without Setting ===&lt;br /&gt;
In some cases, you may want to declare a local variable without setting its value. This can be done by just writing &amp;lt;code&amp;gt;local variableName&amp;lt;/code&amp;gt; without adding a &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a -- a is now initialized as a local variable with no value.&lt;br /&gt;
print(a) --&amp;gt; nil&lt;br /&gt;
a = 3 -- Variables already declared as locals do not need to be marked as local again.&lt;br /&gt;
print(a) --&amp;gt; 3&lt;br /&gt;
}}&lt;br /&gt;
==Types==&lt;br /&gt;
A type is any sort of object, whether it be a few words, a number, a true/false value, etc.&lt;br /&gt;
==={{Type|boolean}}===&lt;br /&gt;
Booleans hold one of two values: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These are typically returned when a relational operator (&amp;lt;code&amp;gt;==&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;=&amp;lt;/code&amp;gt;, etc.) or a boolean operator (&amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, etc.) is used.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(true) --&amp;gt; true&lt;br /&gt;
print(5 &amp;gt; 3) --&amp;gt; true&lt;br /&gt;
print(10 &amp;lt;= 6) --&amp;gt; false&lt;br /&gt;
print(true and false) --&amp;gt; false&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|number}}===&lt;br /&gt;
Numbers are numbers, either integer or decimal.&lt;br /&gt;
&lt;br /&gt;
Numbers are typically returned when an arithmetic operator (&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, etc.) is used.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(5) --&amp;gt; 5&lt;br /&gt;
print(5 + 2) --&amp;gt; 7&lt;br /&gt;
print(5 * 2) --&amp;gt; 10&lt;br /&gt;
print(5 / 2) --&amp;gt; 2.5&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|string}}===&lt;br /&gt;
Strings are sequences of characters, most notably text. When defined in code, strings must be wrapped in either quotes (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) or single quotes (&amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Strings can be modified using the [https://www.lua.org/manual/5.2/manual.html#6.4 String standard library], accessible using either the &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; global or by using the methods on strings themselves.&lt;br /&gt;
&lt;br /&gt;
When defining a string in code, make sure to use &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt; in place of linebreaks within the string. Using real line breaks instead of &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt; will result in a syntax error.&lt;br /&gt;
&lt;br /&gt;
You may also need to escape single/double quotes in case the character you want to use is already used to wrap the string. In that case, just put a backslash (&amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt;) in front of the character to escape it (for example, &amp;lt;code&amp;gt;&amp;quot;\&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; is the same as &amp;lt;code&amp;gt;&#039;&amp;quot;&#039;&amp;lt;/code&amp;gt;). &lt;br /&gt;
====Literal Strings====&lt;br /&gt;
Strings, when surrounded by double brackets (&amp;lt;code&amp;gt;[[]]&amp;lt;/code&amp;gt;), take characters at face value. These are called literal strings and can be used to make a string span multiple lines.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=print(&amp;quot;Hello, World!&amp;quot;) --&amp;gt; Hello, World!&lt;br /&gt;
print(&amp;quot;\&amp;quot;Line 1\&amp;quot;&lt;br /&gt;
&#039;Line 2&#039;&amp;quot;) -- ERROR! unfinished string near &#039;&amp;quot;&amp;quot;Line 1&amp;quot;&#039;&lt;br /&gt;
print(&amp;quot;\&amp;quot;Line 1\&amp;quot;\n&#039;Line 2&#039;&amp;quot;) --&amp;gt; &amp;quot;Line 1&amp;quot;&lt;br /&gt;
                              --  &#039;Line 2&#039;&lt;br /&gt;
print([[&amp;quot;Line 1&amp;quot;&lt;br /&gt;
&#039;Line 2&#039;]]) --&amp;gt; &amp;quot;Line 1&amp;quot;&lt;br /&gt;
            --  &#039;Line 2&#039;&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|nil}}===&lt;br /&gt;
Unlike other types, {{Type|nil}} is the &#039;&#039;absence&#039;&#039; of a value. This is what&#039;s returned when you try to use a variable not defined yet.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=print(a) --&amp;gt; nil&lt;br /&gt;
print(b) --&amp;gt; nil&lt;br /&gt;
print(c) --&amp;gt; 10&lt;br /&gt;
-- Oh, there&#039;s our lovely little global &amp;quot;c&amp;quot; again! Didn&#039;t expect that, did you?&lt;br /&gt;
}}&lt;br /&gt;
Scripts can at best return/display unwanted values and at worst error if a {{Type|nil}} pops up where it shouldn&#039;t.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=string = nil&lt;br /&gt;
local a = &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
print(string.sub(a, 2, 5)) -- ERROR! attempt to index a nil value (global &#039;string&#039;)}}&lt;br /&gt;
==={{Type|table}}===&lt;br /&gt;
Tables are where things start to get more complex. Instead of containing &#039;&#039;one&#039;&#039; object, tables can store &#039;&#039;many&#039;&#039; objects in multiple different ways.&lt;br /&gt;
&lt;br /&gt;
For instance, a table can store a sequence of objects. This is commonly called an array. Arrays start at an index of one and continue counting up for each item added to the table.&lt;br /&gt;
&lt;br /&gt;
However, you don&#039;t &#039;&#039;just&#039;&#039; have to use numbers as indices. You can use any basic object (boolean, number, string, nil) you want! Doing so makes what&#039;s commonly called a dictionary, the indices called keys and the values called values.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=local a = {&amp;quot;Hello,&amp;quot;, &amp;quot;World!&amp;quot;}&lt;br /&gt;
print(a[1]) --&amp;gt; Hello,&lt;br /&gt;
a[&amp;quot;diamond&amp;quot;] = true&lt;br /&gt;
print(a.diamond) --&amp;gt; true -- Doing something like a.diamond is the same as doing a[&amp;quot;diamond&amp;quot;]&lt;br /&gt;
local b = {&lt;br /&gt;
    [c] = true, -- I hope you remember what c is!&lt;br /&gt;
    [true] = 56,&lt;br /&gt;
    [5&amp;lt;3] = b or c -- Expressions can be used as keys and/or values. In this case, (5&amp;lt;3) comes out to true and (c and d) comes out to 10 since d is nil and global c is still 10.&lt;br /&gt;
    [&amp;quot;foo&amp;quot;] = &amp;quot;bar&amp;quot;&lt;br /&gt;
    xyz = &amp;quot;abc&amp;quot; -- String keys can be removed from their brackets and quotes as long as they follow the variable name rules above.&lt;br /&gt;
}&lt;br /&gt;
print(b[b.foo == &amp;quot;bar&amp;quot;]) --&amp;gt; 56 -- Expressions can also be used to index a table.&lt;br /&gt;
}}&lt;br /&gt;
Sometimes, you may want to go over all items within a table. This can be done with a [[#Loops|for loop]].&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Discards/Lua_Basics&amp;diff=554</id>
		<title>User:Slyme/Discards/Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Discards/Lua_Basics&amp;diff=554"/>
		<updated>2024-10-06T05:20:33Z</updated>

		<summary type="html">&lt;p&gt;Slyme: First Draft, following sorta closely to the original.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is &#039;&#039;heavily&#039;&#039; unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;For the time being, please visit the real [[Lua Basics]] page.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==The Interpreter==&lt;br /&gt;
The interpreter is just the thing that runs your Lua code. In Figura&#039;s case, it&#039;s a [https://github.com/FiguraMC/luaj/ custom version of LuaJ], an interpreter written in Java.&lt;br /&gt;
&lt;br /&gt;
A Lua interpreter reads each line sequentially, executing each line before moving on to the next one. This makes it hard to break away from the sequence without breaking the program entirely for something like a sleep call.&lt;br /&gt;
==Comments==&lt;br /&gt;
Comments are used to tell the interpreter to ignore a part of the code, either because it&#039;s for human programmers to see or it&#039;s a piece of code that should not be executed.&lt;br /&gt;
&lt;br /&gt;
Short comments, comments that only affect one line, start with &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;. From the two dashes to the end of the line, code will be ignored.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=--This is a comment.&lt;br /&gt;
local x = 2 -- Everything after the two dashes will be ignored.&lt;br /&gt;
-- local y = 3 -- The preceding code will not run because it&#039;s part of a comment.&lt;br /&gt;
-- This is useful in case you need to document your code for future programmers or you need to stop code from running without removing it from the script.&lt;br /&gt;
}}&lt;br /&gt;
===Long Comments===&lt;br /&gt;
Long comments, comments that can go over multiple lines, come in the form of &amp;lt;code&amp;gt;--[[ ]]&amp;lt;/code&amp;gt;. Everything between the two brackets is commented and, thus, ignored by the interpreter.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=--[[&lt;br /&gt;
  This is a block comment. None of the&lt;br /&gt;
  lines within the comment will be executed&lt;br /&gt;
  until the final bracket.&lt;br /&gt;
--]] -- Sometimes programmers will put two dashes before the end of block comments. This is not required but looks nice.&lt;br /&gt;
local z = 5 -- You can use both types of comments within the same script.&lt;br /&gt;
--[[&lt;br /&gt;
  Block comments are useful for long&lt;br /&gt;
  explanations of code or for ignoring&lt;br /&gt;
  large swaths of code.&lt;br /&gt;
  ]]&lt;br /&gt;
}}&lt;br /&gt;
==Variables==&lt;br /&gt;
Think of variables as a bunch of boxes. Each variable is one box, a label printed on it with an object (or, in some cases, a few) stored inside.&lt;br /&gt;
&lt;br /&gt;
To put something inside a variable, you&#039;ll want to set it equal to that something. For example...&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a = 247 -- Make a new local variable &amp;quot;a&amp;quot; and set  the value within to be the number 247.&lt;br /&gt;
local b = &amp;quot;Hello, World!&amp;quot; -- Make a new local variable &amp;quot;b&amp;quot; and set the value within to be the string &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
c = 10 -- Make a new *global* variable &amp;quot;c&amp;quot; and set the value within to be the number 10.&lt;br /&gt;
}}&lt;br /&gt;
The last variable, &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;, is a global variable. This means that it can be used &#039;&#039;anywhere&#039;&#039; within the Lua environment. While this may seem like a good thing at first, there are many cases where this may not be a thing you want. For example, let&#039;s see how a system like below, assuming each script is run in sequence in the same environment, would fare with global variables&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 1&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-1.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 2&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-2.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=script = 3&lt;br /&gt;
return function() return script end&lt;br /&gt;
 |name=test-script-3.lua&lt;br /&gt;
}}&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(require(&amp;quot;test-script-1&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
print(require(&amp;quot;test-script-2&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
print(require(&amp;quot;test-script-3&amp;quot;)()) --&amp;gt; 3&lt;br /&gt;
 |name=script-checker.lua&lt;br /&gt;
}}&lt;br /&gt;
Watch out for all other instances of &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; throughout the rest of the document, it may interfere with other scripts. ;)&lt;br /&gt;
=== Valid Names ===&lt;br /&gt;
Variable names...&lt;br /&gt;
* Can only use alphanumeric characters and &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;&lt;br /&gt;
* Must not start with a number.&lt;br /&gt;
* Cannot be the same as a Lua keyword (&amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt;, etc.)&lt;br /&gt;
For instance...&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a -- ✅ Valid&lt;br /&gt;
local _b -- ✅ Valid&lt;br /&gt;
local aBc123 -- ✅ Valid&lt;br /&gt;
local 123abc -- ❌ Invalid; Variable names cannot start with a number.&lt;br /&gt;
local foo-bar -- ❌ Invalid; Variable names can only use alphanumeric characters.&lt;br /&gt;
local and -- ❌ Invalid; Variable names cannot be the same as a Lua keyword.&lt;br /&gt;
local local -- ❌ Invalid; Variable names cannot be the same as a Lua keyword.&lt;br /&gt;
}}&lt;br /&gt;
=== Declaring Without Setting ===&lt;br /&gt;
In some cases, you may want to declare a local variable without setting its value. This can be done by just writing &amp;lt;code&amp;gt;local variableName&amp;lt;/code&amp;gt; without adding a &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=local a -- a is now initialized as a local variable with no value.&lt;br /&gt;
print(a) --&amp;gt; nil&lt;br /&gt;
a = 3 -- Variables already declared as locals do not need to be marked as local again.&lt;br /&gt;
print(a) --&amp;gt; 3&lt;br /&gt;
}}&lt;br /&gt;
==Types==&lt;br /&gt;
A type is any sort of object, whether it be a few words, a number, a true/false value, etc.&lt;br /&gt;
==={{Type|boolean}}===&lt;br /&gt;
Booleans hold one of two values: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These are typically returned when a relational operator (&amp;lt;code&amp;gt;==&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;=&amp;lt;/code&amp;gt;, etc.) or a boolean operator (&amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, etc.) is used.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(true) --&amp;gt; true&lt;br /&gt;
print(5 &amp;gt; 3) --&amp;gt; true&lt;br /&gt;
print(10 &amp;lt;= 6) --&amp;gt; false&lt;br /&gt;
print(true and false) --&amp;gt; false&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|number}}===&lt;br /&gt;
Numbers are numbers, either integer or decimal.&lt;br /&gt;
&lt;br /&gt;
Numbers are typically returned when an arithmetic operator (&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, etc.) is used.&lt;br /&gt;
{{Script&lt;br /&gt;
 |script=print(5) --&amp;gt; 5&lt;br /&gt;
print(5 + 2) --&amp;gt; 7&lt;br /&gt;
print(5 * 2) --&amp;gt; 10&lt;br /&gt;
print(5 / 2) --&amp;gt; 2.5&lt;br /&gt;
}}&lt;br /&gt;
==={{Type|string}}===&lt;br /&gt;
Strings are sequences of characters, most notably text. When defined in code, strings must be wrapped in either quotes (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) or single quotes (&amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Strings can be modified using the [https://www.lua.org/manual/5.2/manual.html#6.4 String standard library], accessible using either the &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; global or by using the methods on strings themselves.&lt;br /&gt;
&lt;br /&gt;
====Literal Strings====&lt;br /&gt;
Strings, when surrounded by double brackets (&amp;lt;code&amp;gt;[[]]&amp;lt;/code&amp;gt;), take characters at face value. These are called literal strings and can be used to make a string span multiple lines.&lt;br /&gt;
==={{Type|nil}}===&lt;br /&gt;
Unlike other types, {{Type|nil}} is the &#039;&#039;absence&#039;&#039; of a value. This is what&#039;s returned when you try to use a variable not defined yet.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=print(a) --&amp;gt; nil&lt;br /&gt;
print(b) --&amp;gt; nil&lt;br /&gt;
print(c) --&amp;gt; 10&lt;br /&gt;
-- Oh, there&#039;s our lovely little global &amp;quot;c&amp;quot; again! Didn&#039;t expect that, did you?&lt;br /&gt;
}}&lt;br /&gt;
Scripts can at best return/display unwanted values and at worst error if a {{Type|nil}} pops up where it shouldn&#039;t.&lt;br /&gt;
{{Script&lt;br /&gt;
|script=string = nil&lt;br /&gt;
local a = &amp;quot;Hello, World!&amp;quot;&lt;br /&gt;
print(string.sub(a, 2, 5)) -- ERROR! attempt to index a nil value (global &#039;string&#039;)}}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Script&amp;diff=553</id>
		<title>Template:Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Script&amp;diff=553"/>
		<updated>2024-10-06T03:23:43Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Created page with &amp;quot;&amp;lt;templatestyles src=&amp;quot;Template:Script/style.css&amp;quot;/&amp;gt; &amp;lt;div class=&amp;quot;scriptbox&amp;quot;&amp;gt;{{#if:{{{name|}}}|&amp;lt;div class=&amp;quot;scriptname&amp;quot;&amp;gt;{{{name}}}&amp;lt;/div&amp;gt;|}} {{#tag:syntaxHighlight|{{{1|{{{script}}}}}}|lang=&amp;quot;lua&amp;quot;|start={{{line}}}|line=}} &amp;lt;/div&amp;gt; &amp;lt;noinclude&amp;gt; &amp;lt;templatedata&amp;gt; { 	&amp;quot;params&amp;quot;: { 		&amp;quot;name&amp;quot;: { 			&amp;quot;label&amp;quot;: &amp;quot;Script Name&amp;quot;, 			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, 			&amp;quot;required&amp;quot;: false,             &amp;quot;description&amp;quot;: &amp;quot;The name of the script, to be shown as a label header.&amp;quot; 		}, 		&amp;quot;script&amp;quot;: { 			&amp;quot;aliases&amp;quot;: [ 				&amp;quot;1&amp;quot;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;templatestyles src=&amp;quot;Template:Script/style.css&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;scriptbox&amp;quot;&amp;gt;{{#if:{{{name|}}}|&amp;lt;div class=&amp;quot;scriptname&amp;quot;&amp;gt;{{{name}}}&amp;lt;/div&amp;gt;|}}&lt;br /&gt;
{{#tag:syntaxHighlight|{{{1|{{{script}}}}}}|lang=&amp;quot;lua&amp;quot;|start={{{line}}}|line=}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;name&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Script Name&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: false,&lt;br /&gt;
            &amp;quot;description&amp;quot;: &amp;quot;The name of the script, to be shown as a label header.&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;script&amp;quot;: {&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;1&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Script&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;The script to be displayed&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
        &amp;quot;line&amp;quot;: {&lt;br /&gt;
            &amp;quot;label&amp;quot;: &amp;quot;Line Number&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
            &amp;quot;required&amp;quot;: false,&lt;br /&gt;
            &amp;quot;description&amp;quot;: &amp;quot;What number to start counting on.&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;paramOrder&amp;quot;: [&lt;br /&gt;
		&amp;quot;script&amp;quot;,&lt;br /&gt;
		&amp;quot;name&amp;quot;,&lt;br /&gt;
        &amp;quot;line&amp;quot;&lt;br /&gt;
	]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=552</id>
		<title>Template:Script/style.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=552"/>
		<updated>2024-10-06T03:23:09Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;pre {&lt;br /&gt;
	margin-top: 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.scriptbox {&lt;br /&gt;
	margin-top: 14px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.scriptname {&lt;br /&gt;
	margin-bottom: .5em;&lt;br /&gt;
	font-weight: bold;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=551</id>
		<title>Template:Script/style.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=551"/>
		<updated>2024-10-06T03:22:35Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;pre {&lt;br /&gt;
	margin-top: 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.scriptbox {&lt;br /&gt;
	margin-top: 14px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.scriptname {&lt;br /&gt;
	margin-bottom: .5em;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=550</id>
		<title>Template:Script/style.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=550"/>
		<updated>2024-10-06T03:20:35Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;pre {&lt;br /&gt;
	margin-top: 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.scriptbox {&lt;br /&gt;
	margin-top: 14px;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=549</id>
		<title>Template:Script/style.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=549"/>
		<updated>2024-10-06T03:20:20Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;pre {&lt;br /&gt;
	margin-top: 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
scriptbox {&lt;br /&gt;
	margin-top: 14px;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=548</id>
		<title>Template:Script/style.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Script/style.css&amp;diff=548"/>
		<updated>2024-10-06T03:16:19Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Created page with &amp;quot;pre { 	margin-top: 0; }&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;pre {&lt;br /&gt;
	margin-top: 0;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=547</id>
		<title>Community Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=547"/>
		<updated>2024-10-06T01:15:05Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Remove the &amp;quot;heavily unfinished&amp;quot; notice, I&amp;#039;ve finished out the assets.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some of the resources listed here are not officially endorsed by FiguraMC.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Resources affiliated with FiguraMC will be marked as such with a ⭐ icon.&lt;br /&gt;
}}&lt;br /&gt;
= Documentation =&lt;br /&gt;
===[https://applejuiceyy.github.io/figs/ Figs]===&lt;br /&gt;
&#039;&#039;&#039;Figs&#039;&#039;&#039; is an online documentation browser for Figura, making using Figura&#039;s built-in documentation easier to use.&lt;br /&gt;
===[https://wiki.figuramc.org Figura Wiki] (YOU ARE HERE) ⭐===&lt;br /&gt;
The &#039;&#039;&#039;Figura Wiki&#039;&#039;&#039; is an online wiki that aims to document Figura, its scripting language, modeling, etc.&lt;br /&gt;
== Lua Documenation ==&lt;br /&gt;
===[https://manuel-3.github.io/lua-quickstart Lua Quickstart Guide]===&lt;br /&gt;
&#039;&#039;&#039;Manuel&#039;s Lua Quickstart Guide&#039;&#039;&#039; is a quick, online tutorial guiding users through the basics of Lua syntax.&lt;br /&gt;
===[http://lua.org/manual/5.1 Lua 5.1 Manual]===&lt;br /&gt;
The &#039;&#039;&#039;Lua Manual&#039;&#039;&#039; is a long document describing the ins and outs of vanilla Lua. Although some of it will not apply to Figura Lua, it&#039;s still very useful for learning about the standard libraries.&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
===[https://www.youtube.com/playlist?list=PLNz7v2g2SFA8lOQUDS4z4-gIDLi_dWAhl Chloe&#039;s Video Tutorial Series]===&lt;br /&gt;
&#039;&#039;&#039;Chloe&#039;s Tutorial Series&#039;&#039;&#039; is a video series on YouTube that acts as a way for new users to get used to the mod. The series covers everything from modeling and modifying &amp;lt;code&amp;gt;avatar.json&amp;lt;/code&amp;gt; files to scripting.&lt;br /&gt;
= Tools =&lt;br /&gt;
===[https://github.com/GrandpaScout/FiguraRewriteVSDocs GS&#039; Figura VSCode Documentation]===&lt;br /&gt;
&#039;&#039;&#039;GrandpaScout&#039;s Figura VSCode Documentation&#039;&#039;&#039; is an addon for Visual Studio Code (along with Code OSS and VSCodium) that adds Figura&#039;s documentation and snippets to [https://marketplace.visualstudio.com/items?itemName=sumneko.lua sumneko&#039;s Lua Language Server plugin].&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/GrandpaScout/FiguraRewriteVSDocs/wiki Install Guide]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/KitCat962/figura-format-bbplugin Katt&#039;s Figura Blockbench Extension]===&lt;br /&gt;
The &#039;&#039;&#039;Figura Blockbench Extension&#039;&#039;&#039; adds a new model format to Blockbench, the Figura Model format. It extends the base Generic Model format by adding tools to make the avatar creation process easier, lifting restrictions to the Generic Model format that Figura supports, and removing features Figura doesn&#039;t.&lt;br /&gt;
= Assets (Scripts, Libraries, APIs) =&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some assets only exist within the [https://discord.figuramc.org FiguraMC Discord].&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Assets that link to the FiguraMC Discord will be marked with a 💬 icon.&lt;br /&gt;
}}&lt;br /&gt;
== Script Helpers ==&lt;br /&gt;
===[https://github.com/Manuel-3/figura-scripts/tree/main/src/runLater Run Later]===&lt;br /&gt;
&#039;&#039;&#039;Run Later&#039;&#039;&#039; is a script that allows users to run code after a set amount of time or after a condition is met, similar to a wait/sleep/halt instruction except it runs a function after the wait instead of the rest of the code.&lt;br /&gt;
== Animation Helpers ==&lt;br /&gt;
===[https://github.com/GrandpaScout/GSAnimBlend GSAnimBlend]===&lt;br /&gt;
&#039;&#039;&#039;GSAnimBlend&#039;&#039;&#039; is a script that automatically adds blends to the start and end of animations.&lt;br /&gt;
===[https://github.com/JimmyHelp/JimmyAnims Jimmy&#039;s Animation Handler]===&lt;br /&gt;
&#039;&#039;&#039;JimmyAnim&#039;&#039;&#039; (full name Jimmy&#039;s Animation Helper) is a library that plays specific Blockbench animations based on the player&#039;s current action.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://jimmyhelp.notion.site/JimmyAnims-79adfdca2fe04f9c9ede5e0bfd898b6a Documentation]&lt;br /&gt;
* [https://github.com/JimmyHelp/JimmyAnims/blob/main/JimmyExample.lua Example Usage]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
== World Interactions==&lt;br /&gt;
===[https://discord.com/channels/1129805506354085959/1132467393050968214/1132467393050968214 Origins API] 💬===&lt;br /&gt;
Katt&#039;s &#039;&#039;&#039;Origins API&#039;&#039;&#039; is an API that uses the player&#039;s NBT data to get information about the player&#039;s [https://modrinth.com/mod/origins Origin].&lt;br /&gt;
===[https://github.com/GrandpaScout/GSServerNet GSServerNet]===&lt;br /&gt;
&#039;&#039;&#039;GSServerNet&#039;&#039;&#039; allows Figura to communicate with the server/world the player is in using a companion datapack.&lt;br /&gt;
==Visual Elements==&lt;br /&gt;
===[https://github.com/Manuel-3/figura-scripts/tree/main/src/confetti Confetti]===&lt;br /&gt;
&#039;&#039;&#039;Confetti&#039;&#039;&#039; is a library that allows users to add custom particles, either sprite or modelpart, to their avatars&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/readme.md Documentation]&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/example.zip Example Avatar]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://discord.com/channels/1129805506354085959/1137506926742216835 KattArmor] 💬===&lt;br /&gt;
&#039;&#039;&#039;KattArmor&#039;&#039;&#039; (sometimes called Katt Armor API/Library) is a library that allows users to edit their avatar&#039;s armor, whether by adding pivots using a script or by using unique models and textures.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://discord.com/channels/1129805506354085959/1137506926742216835/1155212562980425818 How-To Guide]&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1262160359905562705 Example Avatars]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/MitchOfTarcoola/MOARArmsAPI MOAR Arms API]===&lt;br /&gt;
&#039;&#039;&#039;MOAR Arms API&#039;&#039;&#039; is a library that makes making an avatar with multiple arms easier, allowing an avatar to appear to hold more than two items at once.&lt;br /&gt;
===[https://github.com/lua-gods/figuraLibraries/tree/main/tail%20and%20ears Tail and Ears Physics]===&lt;br /&gt;
&#039;&#039;&#039;Tail and Ears Physics&#039;&#039;&#039; is a script that gives physics to a set of ears and multiple parts of a tail.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/lua-gods/figuraLibraries/blob/main/tail%20and%20ears/examples.lua Example Usage]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/lua-gods/figuraLibraries/blob/main/plushie/plushie.lua Plushie]===&lt;br /&gt;
&#039;&#039;&#039;Plushie&#039;&#039;&#039; snaps a skull model (specified in the config) to the floor below it and scales the model based on the amount above it.&lt;br /&gt;
&lt;br /&gt;
= Community =&lt;br /&gt;
===[https://discord.figuramc.org FiguraMC Discord] ⭐===&lt;br /&gt;
The &#039;&#039;&#039;FiguraMC Discord Server&#039;&#039;&#039; is the central place for everything Figura, including help and support for the mod, avatar showcasing, and more. You&#039;ll also need to join this server to request whitelist to the FiguraSMP.&lt;br /&gt;
== Minecraft Servers ==&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some servers listed below are whitelisted.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Servers that have a public whitelist application process will be marked with a 🔒 icon.&lt;br /&gt;
* Servers that are invite-only will be marked with a 🛡️ icon.&lt;br /&gt;
}}&lt;br /&gt;
=== Figura Plaza ⭐ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;plaza.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version: 1.16.5 - 1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; is an official lobby-like server where players can join, hang out with other Figura users, make avatars in company, play games, and occasionally attend events. The server does not have any survival gameplay, and disables PvP by default. The server also provides a selection of free temporary items to use when testing avatars.&lt;br /&gt;
&lt;br /&gt;
=== Figura SMP ⭐🔒 ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;vanilla.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura SMP&#039;&#039;&#039; (also referred to as Vanilla SMP) is an official survial server that stays close to the base game, plus a few server-side mods for quality-of-life purposes. You are perfectly able to join this server without any mods, and even on a vanilla client. You can read the server rules in the [https://discord.figuramc.org FiguraMC Discord Server]&#039;s [https://discord.com/channels/1129805506354085959/1130186794873405510 #info] channel and get whitelisted by putting your name in [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist].&lt;br /&gt;
&lt;br /&gt;
==== Modded SMP ====&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1-fabric&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Modpack:&amp;amp;nbsp;&amp;lt;span style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Modded SMP&#039;&#039;&#039; is a seasonal modpack server adjacent to Figura SMP, each season coming with its own theme. &#039;&#039;&#039;Currently offline.&#039;&#039;&#039; The next season is themed after a nuclear apocalypse and is set for release Soon™. The ModdedSMP shares a whitelist with the VanillaSMP, meaning that [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist] will whitelist you for both servers.&lt;br /&gt;
&lt;br /&gt;
=== 4p5.nz 🛡️ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;4p5.nz&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; is an invite-only creative/operator server where players have free reign over the world around them.&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Lua_Basics&amp;diff=546</id>
		<title>Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Lua_Basics&amp;diff=546"/>
		<updated>2024-10-06T01:13:33Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Remove that warning at the top.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice&lt;br /&gt;
| content = I highly recommend reading the [https://www.lua.org/manual/5.2/ Lua Reference] and [https://www.lua.org/pil/contents.html Programming in Lua] if you have the time. I provide a basic rundown of the most used functionality for Figura, but not everything gets covered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==How a computer reads code==&lt;br /&gt;
Code is basically just a list of instructions telling the computer step by step what to do. It is read line-by-line and the instructions are executed right away.&lt;br /&gt;
==Comments==&lt;br /&gt;
When there are 2 minus signs &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;, everything after it is ignored by Lua. These are called comments. They have no effect on the code that is executed and can be safely removed. Their primary purpose is to add raw text that can be used to aid in the understanding of code.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Comments are not compiled and do not affect code&lt;br /&gt;
local a = 2 -- Everything up to the next newline will be ignored.&lt;br /&gt;
-- Can also be used to hide code from the compiler without actually removing it:&lt;br /&gt;
-- local b = 4&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Another form of comment is &amp;lt;code&amp;gt;--[[  ]]&amp;lt;/code&amp;gt;. When this is used, everything between the square bracket pairs will be ignored. Newlines do not affect this. This type of comment is commonly referred to as a Long Comment.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 2&lt;br /&gt;
--[[ comment comment&lt;br /&gt;
ignores newlines &lt;br /&gt;
ignores pretty much everything&lt;br /&gt;
]] local b=2 --long comments end strictly at the `]]`&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
==Variables==&lt;br /&gt;
Variables store values. Lua is a dynamically typed language, meaning any variable can store a value of any type. You can define a variable using the `local` keyword. Local variables are accessible below the line they were declared, but will not breach their scope.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Most of the time, you will want to instantly assign a value to that variable. In lua, if you use `=` it will store the value on the right inside the variable on the left.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 2 -- the variable named &amp;quot;a&amp;quot; now stores the value 2&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
After a variable has been declared, you can assign a new value to it by using &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; again. Note that the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; keyword is only used when creating the variable for the first time.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 2&lt;br /&gt;
a = 4 -- the variable &amp;quot;a&amp;quot; now stores 4&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Multiple variables can be declared and assigned on one line.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a, b = 1, 2&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Variables are limited in what characters can be used as an identifier (variable name). Only letters, numbers, and `_` can be used in a valid identifier, and it cannot start with a number. None of Lua&#039;s keywords (&amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt;, etc.) can be used as a variable name.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a123&lt;br /&gt;
local _b&lt;br /&gt;
local KEKW&lt;br /&gt;
local 123A -- invalid. Starts with a number.&lt;br /&gt;
local has-water -- invalid. Uses character `-`&lt;br /&gt;
local and -- invalid. `and` is a lua keyword.&lt;br /&gt;
local local -- invalid. `local` is a lua keyword.&lt;br /&gt;
local _ -- This name specifically is used to denote throwaway variables in loops.&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
If you assign a value to a value to a variable that has not been declared using &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt;, you will create a &#039;&#039;global&#039;&#039; variable. Global variables are accessible from the entire Lua environment. This may seem like a good thing to the inexperienced, but because they are accessible anywhere it is common for users to make mistakes when they reuse global variables for other purposes and accidentally overwrite it.&amp;lt;br&amp;gt;&lt;br /&gt;
There is almost never a good reason for using global variables, so always stick to &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- c was not declared local beforehand,&lt;br /&gt;
-- meaning there is now the value `10` at global variable `c`&lt;br /&gt;
c = 10&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Variables can be used in place of values.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 2&lt;br /&gt;
print(a) --&amp;gt; prints `2` to the chat&lt;br /&gt;
a = a + a&lt;br /&gt;
print(a) --&amp;gt; prints `4` to the chat&lt;br /&gt;
a = a + a&lt;br /&gt;
print(a) --&amp;gt; prints `8` to the chat&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
When you try to use a variable that hasnt been assigned a value, the value `nil` will be returned.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a&lt;br /&gt;
print(a) --&amp;gt; nil&lt;br /&gt;
print(d) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
print(c) --&amp;gt; 10 (the global variable we declared earlier lol)&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
&lt;br /&gt;
A function contains code that can be executed by calling the function. This is useful if you want to use the same code multiple times and can make your code more structured.&lt;br /&gt;
&lt;br /&gt;
To define a function you use the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; keyword, then the name of the function and &amp;lt;code&amp;gt;()&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
Any code after it will be considered inside this function, until you tell Lua that the function is done here by using the &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; keyword. For better readability we indent the code inside the function using spaces or tabs.&amp;lt;br&amp;gt;&lt;br /&gt;
The print statement will not execute until the function is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function hello()&lt;br /&gt;
    print(&amp;quot;Hello function!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever you call a function by putting &amp;lt;code&amp;gt;()&amp;lt;/code&amp;gt; after the function name, all the code inside the function will run line by line first, before continuing with the rest of your code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
print(&amp;quot;Outside.&amp;quot;)&lt;br /&gt;
hello()&lt;br /&gt;
print(&amp;quot;Below hello.&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
This will output the following:&lt;br /&gt;
 Outside.&lt;br /&gt;
 Hello function!&lt;br /&gt;
 Below hello.&lt;br /&gt;
You can also give the function some values to work with by putting variable names inside the &amp;lt;code&amp;gt;()&amp;lt;/code&amp;gt;. These variables are called parameters. The function can also return a new value itself that is accessible from where the function is called. If no &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; is specified, the function returns &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; (see &amp;quot;Types&amp;quot; section below).&amp;lt;br&amp;gt;&lt;br /&gt;
Here is an example of a function that calculates the sum of two numbers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function sum(a,b)    -- parameters seperated by commas&lt;br /&gt;
    local s = a + b  -- calculate the sum&lt;br /&gt;
    return s         -- return the sum to be used by tha caller&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local var1 = 2&lt;br /&gt;
local var2 = 8&lt;br /&gt;
local var3 = sum(var1, var2) -- call the function and pass two variables. note that these do not have to be called a and b&lt;br /&gt;
print(var3) --&amp;gt; 10, as you might have noticed, `print` is also a function that takes a parameter&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Values==&lt;br /&gt;
Values represent some form of data.&amp;lt;br&amp;gt;&lt;br /&gt;
There are many types of values for storing different types of data.&lt;br /&gt;
&lt;br /&gt;
===boolean===&lt;br /&gt;
A boolean is a data type with 2 distinct values: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Most operators return a boolean and it&#039;s current state can be inverted with &amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = true&lt;br /&gt;
print(a) --&amp;gt; true&lt;br /&gt;
print(not a) --&amp;gt; false&lt;br /&gt;
a = not a -- a = false&lt;br /&gt;
print(a) --&amp;gt; false&lt;br /&gt;
print(not a) --&amp;gt; true&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===number===&lt;br /&gt;
A number is, well, a number.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers can use arithmetic operators.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 14&lt;br /&gt;
local b = 4&lt;br /&gt;
print(a+b) --&amp;gt; 18&lt;br /&gt;
print(a-b) --&amp;gt; 10&lt;br /&gt;
print(a*b) --&amp;gt; 56&lt;br /&gt;
print(a/b) --&amp;gt; 3.5&lt;br /&gt;
print(a%b) --&amp;gt; 2&lt;br /&gt;
local c = 3.1459&lt;br /&gt;
local d = math.pi&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===string===&lt;br /&gt;
A string is a sequence of characters.&amp;lt;br&amp;gt;&lt;br /&gt;
Mostly used for holding and manipulating text data.&lt;br /&gt;
&lt;br /&gt;
[https://www.lua.org/manual/5.2/manual.html#6.4 String functions] are accessible through the &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; global variable. All string values also contain these functions within themselves.&lt;br /&gt;
&lt;br /&gt;
Strings are defined by encasing text in double quotes (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) or single quotes (&amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
If you try to put a newline in a string, Lua will refuse and throw a syntax error. Newlines must be encoded into a string using other characters. Specifically &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
If you need to have either a &amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; in a string and you cannot wrap the string in another quote type, you can escape the quote using &amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Long Strings are defined by encasing text in 2 square brackets (&amp;lt;code&amp;gt;[[]]&amp;lt;/code&amp;gt;). Long strings capture every single character between the pairs of square brackets including raw newlines.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local str = &amp;quot;foo&amp;quot;&lt;br /&gt;
print(str .. &amp;quot; bar&amp;quot;)                          --&amp;gt; foo bar&lt;br /&gt;
&lt;br /&gt;
local a = &amp;quot;This string has \&amp;quot;quotes\&amp;quot; in it.&amp;quot;&lt;br /&gt;
print(a)                                       --&amp;gt; This string has &amp;quot;quotes&amp;quot; in it.&lt;br /&gt;
&lt;br /&gt;
local b = &amp;quot;This will result in&lt;br /&gt;
a syntax error&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local c = &amp;quot;This \nwill \nnot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local d = [[neither &lt;br /&gt;
will &lt;br /&gt;
this]]&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===table===&lt;br /&gt;
A Lua table is a data structure that stores many values.&lt;br /&gt;
&lt;br /&gt;
Tables operate on key-value pairs. You give the table a key in the form of a value, and it returns a value.&amp;lt;br&amp;gt;&lt;br /&gt;
Assigning works the same way. Give the table a key, and assign a value to the table at that key.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Define an empty table&lt;br /&gt;
local tbl = {}&lt;br /&gt;
-- Store the value 23 in the table with the key 54&lt;br /&gt;
tbl[54] = 23&lt;br /&gt;
-- Store the value false in the table with the key &amp;quot;stringKey&amp;quot;&lt;br /&gt;
tbl[&amp;quot;stringKey&amp;quot;] = false&lt;br /&gt;
&lt;br /&gt;
-- variables can be inputted, using their value as the key.&lt;br /&gt;
-- For instance, let&#039;s use our global c (which, if you don&#039;t remember, was set to 10) from earlier.&lt;br /&gt;
tbl[c] = &amp;quot;123&amp;quot;&lt;br /&gt;
&lt;br /&gt;
tbl[67] = tbl[54]&lt;br /&gt;
&lt;br /&gt;
print(tbl[54]) --&amp;gt; 23&lt;br /&gt;
print(tbl[&amp;quot;stringKey&amp;quot;]) --&amp;gt; false&lt;br /&gt;
print(tbl[10]) --&amp;gt; &amp;quot;123&amp;quot;&lt;br /&gt;
print(tbl[67]) --&amp;gt; 23&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
If your key is a string, you can use a different way of indexing that is easier to do. Do note that only strings that abide by identifier rules can be used this way. If the string is not a valid identifier, use &amp;lt;code&amp;gt;[]&amp;lt;/code&amp;gt; indexing&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local data={}&lt;br /&gt;
data.name=&amp;quot;Chocolate&amp;quot;&lt;br /&gt;
data.amount=100&lt;br /&gt;
data.delicious=true&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Unlike other values which are passed around by value, tables are passed by reference.&amp;lt;br&amp;gt;&lt;br /&gt;
What this means is that when you create a table and assign it to a variable, then assign it to a different variable, you do not have 2 tables. You have 2 variables pointing to the same table.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = {}&lt;br /&gt;
local b = a&lt;br /&gt;
local c = {}&lt;br /&gt;
print(a) --&amp;gt; table4b8ab37d&lt;br /&gt;
print(b) --&amp;gt; table4b8ab37d&lt;br /&gt;
print(c) --&amp;gt; table82f1e9c2&lt;br /&gt;
-- table equality works on &amp;quot;is this the same table?&amp;quot;.&lt;br /&gt;
-- The values inside do not matter.&lt;br /&gt;
print(a == b) --&amp;gt; true&lt;br /&gt;
print(a == c) --&amp;gt; false&lt;br /&gt;
-- same table in memory.&lt;br /&gt;
a.reeee = 2&lt;br /&gt;
print(b.reeee) --&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===nil===&lt;br /&gt;
&amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; is commonly referred to as the absence of data.&amp;lt;br&amp;gt;&lt;br /&gt;
It is what is returned when no data is present.&lt;br /&gt;
&lt;br /&gt;
===function===&lt;br /&gt;
Yes, functions are also a type of variable.&lt;br /&gt;
&lt;br /&gt;
An alternative way to name a function to what we learned before is by assigning a function to a variable.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = function()&lt;br /&gt;
    print(&amp;quot;function was called&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is functionally the same thing as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function a()&lt;br /&gt;
    print(&amp;quot;function was called&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like tables, functions are passed by reference, and equality is based on &amp;quot;is this the same function?&amp;quot;. The actual contents of the function are not evaluated, so identical looking functions, while similar, are not equal.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a=print&lt;br /&gt;
print(a == print) --&amp;gt; true&lt;br /&gt;
&lt;br /&gt;
local b=function() end&lt;br /&gt;
local c=function() end&lt;br /&gt;
print(b == c) --&amp;gt; false&lt;br /&gt;
&lt;br /&gt;
c = b&lt;br /&gt;
print(b == c) --&amp;gt; true&lt;br /&gt;
&lt;br /&gt;
print(b()) --&amp;gt; nil, because b does not return anything&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since functions are just another value type, they can be used as arguments to other functions.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function do10(func)&lt;br /&gt;
    for i=1,10 do -- this just means &amp;quot;repeat 10 times&amp;quot; increasing the variable `i` every time&lt;br /&gt;
        func(i)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
do10(print) --&amp;gt; 1,2,3,4,5,6,7,8,9,10&lt;br /&gt;
do10(function(v)&lt;br /&gt;
    print(v*2)&lt;br /&gt;
end) --&amp;gt; 2,4,6,8,10,12,14,16,18,20&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Functions have access to all variables defined above where the function gets defined. Variables below where the function is defined is considered &amp;quot;out of scope&amp;quot; of the function.&amp;lt;br&amp;gt;&lt;br /&gt;
If a variable is used that is not defined above the function, the global variable with that identifier will be used&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 10&lt;br /&gt;
local b = &amp;quot;string lol&amp;quot;&lt;br /&gt;
local function d()&lt;br /&gt;
    print(a)&lt;br /&gt;
    print(b)&lt;br /&gt;
    print(c) -- there is no `c` variable defined above here, so the global `c` will be used.&lt;br /&gt;
end&lt;br /&gt;
local c = 20&lt;br /&gt;
d()&lt;br /&gt;
--&amp;gt; 10&lt;br /&gt;
--&amp;gt; &amp;quot;string lol&amp;quot;&lt;br /&gt;
--&amp;gt; 10&lt;br /&gt;
-- If you forgot the countless times we&#039;ve used the global c through this entire page, c is still 10.&lt;br /&gt;
&lt;br /&gt;
local function e(b)&lt;br /&gt;
    print(a)&lt;br /&gt;
    print(b)    -- variable `b` is redefined as a function parameter, so the other `b` is scope gets overshadowed&lt;br /&gt;
    print(c)    -- There *is* a `c` variable within scope this time&lt;br /&gt;
end&lt;br /&gt;
e(&amp;quot;string kek&amp;quot;)&lt;br /&gt;
--&amp;gt; 10&lt;br /&gt;
--&amp;gt; &amp;quot;string kek&amp;quot;&lt;br /&gt;
--&amp;gt; 20&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
If a function is one of the values in a table, special syntax can be used to have the table itself be the first argument to the function. By indexing the function with colon (&amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;) Lua will put the table itself as the first argument.&lt;br /&gt;
&lt;br /&gt;
This is used heavily in Figura for many of its APIs. All objects of the same type share the exact same functions, differentiated only by the object placed in the first argument.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local tbl={}&lt;br /&gt;
tbl.key = function(t, a, b)&lt;br /&gt;
    t[a] = b&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
tbl:key(&amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- this is functionally equivalent&lt;br /&gt;
tbl.key(tbl, &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- You can also use `:` when creating functions. The implied `self` argument will be used to refer to the first argument&lt;br /&gt;
function tbl:key(a, b)&lt;br /&gt;
    self[a] = b&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===userdata===&lt;br /&gt;
Lua is commonly used when embedded in other software. In this case, it is embedded inside of Figura.&amp;lt;br&amp;gt;&lt;br /&gt;
userdata is the means of communicating with that software.&lt;br /&gt;
&lt;br /&gt;
userdata is basically data initialized in Figura that gets interpreted as a Lua value. They function most similar to tables in the fact that they are indexed the same way to receive values, mostly functions.&lt;br /&gt;
&lt;br /&gt;
This is why knowing when to use `:` to index userdata is important.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- `models` is a value of type userdata. More specifically, it is a ModelPart created in Java and made accessible in Lua.&lt;br /&gt;
-- userdata commonly overrides what the print and tostring functions return to improve the ability to debug code.&lt;br /&gt;
print(models) --&amp;gt; models (ModelPart)&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
==Variable Scope==&lt;br /&gt;
A Variable&#039;s Scope is the area the variable is accessible from.&lt;br /&gt;
&lt;br /&gt;
A variable&#039;s scope begins when it is declared, and extends until the end of the current block.&amp;lt;br&amp;gt;&lt;br /&gt;
The scope of global variables is the Lua environment itself and will not clear until Lua itself is shut down.&lt;br /&gt;
&lt;br /&gt;
All [[#control_statements|control statements]] will create new scopes when used. Functions also create their on scope when declared&amp;lt;br&amp;gt;&lt;br /&gt;
The `do end` statement can be used to create scopes, and doesn&#039;t have any other functionality. I will be using it to showcase how scopes affect variables, as explaining it raw will not get the point across. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a=4&lt;br /&gt;
local b=8&lt;br /&gt;
do&lt;br /&gt;
    -- a and b are accessible here&lt;br /&gt;
    local c = 12&lt;br /&gt;
    -- a, b, and c are accessible here&lt;br /&gt;
    a = 16 -- variable `a` in the outer scope is now `16`&lt;br /&gt;
&lt;br /&gt;
    local b = 20 -- b in the other scope has been overshadowed by this variable. All future references to `b` will refer to this variable (until the end of the scope)&lt;br /&gt;
&lt;br /&gt;
    print(a,b,c,d) --&amp;gt; 16, 20, 12, nil&lt;br /&gt;
end&lt;br /&gt;
print(a,b,c,d) --&amp;gt; 16, 8, 10, nil&lt;br /&gt;
-- Global c is still 10.&lt;br /&gt;
&lt;br /&gt;
local e&lt;br /&gt;
do&lt;br /&gt;
    local f=0&lt;br /&gt;
&lt;br /&gt;
    -- interesting thing is that functions capture the current scope.&lt;br /&gt;
    -- Even if we leave the scope, the function remembers the upvalue `f` and will continue to use it even if the scope `f` belongs to ends&lt;br /&gt;
    -- oh yea `a` is overshadowed here too. But thats not as interesting.&lt;br /&gt;
    e=function(a)&lt;br /&gt;
        f=f+1&lt;br /&gt;
        print(f, a)&lt;br /&gt;
    end&lt;br /&gt;
    e()--&amp;gt; 1, nil&lt;br /&gt;
    e()--&amp;gt; 2, nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
e()    --&amp;gt; 3, nil&lt;br /&gt;
e(&amp;quot;a&amp;quot;) --&amp;gt; 4, &amp;quot;a&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
==Value Truthiness==&lt;br /&gt;
All values have an implicit truthiness when used in the context of a boolean.&lt;br /&gt;
&lt;br /&gt;
It&#039;s simple to remember: &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; are both considered &amp;quot;falsely&amp;quot;, and every other value is considered &amp;quot;truthy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Truthiness is used in control statements, see the section about it below.&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
Operators, similar functions, take 1 or 2 values and outputs a result.&amp;lt;br&amp;gt;&lt;br /&gt;
They commonly take the form &amp;lt;code&amp;gt;leftSide operator rightSide&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
I will continue to refer to the 2 values that operators operate on as &amp;lt;code&amp;gt;leftSide&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rightSide&amp;lt;/code&amp;gt; for the duration of this section.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Operators have a priority system. It is surprisingly intuitive, but can be forced by surrounding the code you want to guarantee execute first in brackets `()`. For the true priority list, check out the [https://www.lua.org/manual/5.2/manual.html#3.4.7 Lua Reference Manual].&lt;br /&gt;
&lt;br /&gt;
Do note that despite me saying that &amp;quot;Only x can use this operator&amp;quot;, tables and userdata types are always exempt from this rule. However, they must be explicitly written to support these operators, so most will not support it by default.&lt;br /&gt;
===Arithmetic Addition (+)===&lt;br /&gt;
Its addition. 1+1 returns 2. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Subtraction (-)===&lt;br /&gt;
Its subtraction. 2-3 returns -1. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Multiplication (*)===&lt;br /&gt;
Its multiplication. 2*4 returns 8. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Division (/)===&lt;br /&gt;
Its division. 5/2 returns 2.5. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Modulo (%)===&lt;br /&gt;
Division actually has 2 components. The whole component, and the remainder component.&amp;lt;br&amp;gt;&lt;br /&gt;
Modulo returns this remainder component after the division leftSide/rightSide is done.&amp;lt;br&amp;gt;&lt;br /&gt;
5%2 returns 1, because 2 goes into 5 2 whole times, 2*2=4, 5-4=1.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Exponentiation (^)===&lt;br /&gt;
Its exponents. 2^3 returns 8. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Negation (-)===&lt;br /&gt;
Only operates on the rightSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This operator negates the number, similar to just adding a negative symbol in front of it.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a= -2&lt;br /&gt;
a=-a&lt;br /&gt;
print(a) --&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===Relational Equality (==)===&lt;br /&gt;
Returns `true` if both values are considered the same value, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
All values can use this operator.&lt;br /&gt;
===Relational Inequality (~=)===&lt;br /&gt;
Returns `false` if both values are considered the same value, `true` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
All values can use this operator.&lt;br /&gt;
===Relational Less Than (&amp;lt;)===&lt;br /&gt;
Returns `true` if the leftSide is considered less then the rightSide, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers compare as expected.&lt;br /&gt;
Strings compare using their ascii representations, comparing each character left to right until they are not equal. Then the operator is applied to those 2 character&#039;s ascii numbers and returned.&lt;br /&gt;
===Relational Greater Than (&amp;gt;)===&lt;br /&gt;
Returns `true` if the leftSide is considered greater then the rightSide, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers compare as expected.&lt;br /&gt;
Strings compare using their ascii representations, comparing each character left to right until they are not equal. Then the operator is applied to those 2 character&#039;s ascii numbers and returned.&lt;br /&gt;
===Relational Less Than or Equal To (&amp;lt;=)===&lt;br /&gt;
Returns `true` if the leftSide is considered less then or equal to the rightSide using equality operator rules, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers compare as expected.&lt;br /&gt;
Strings compare using their ascii representations, comparing each character left to right until they are not equal. Then the operator is applied to those 2 character&#039;s ascii numbers and returned.&lt;br /&gt;
===Relational Greater Than or Equal To (&amp;gt;=)===&lt;br /&gt;
Returns `true` if the leftSide is considered greater then or equal to the rightSide using equality operator rules, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers compare as expected.&lt;br /&gt;
Strings compare using their ascii representations, comparing each character left to right until they are not equal. Then the operator is applied to those 2 character&#039;s ascii numbers and returned.&lt;br /&gt;
===Logical And (and)===&lt;br /&gt;
This operator operates on truthiness.&amp;lt;br&amp;gt;&lt;br /&gt;
If the leftSide is considered truthy, it returns the rightSide. Otherwise, it returns the leftSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This ends up with the return value being truthy only if both leftSide &#039;&#039;and&#039;&#039; rightSide are truthy.&amp;lt;br&amp;gt;&lt;br /&gt;
The following table puts this visually. L is leftSide, R is rightSide. F and T represent if the value is falsy or truthy, and the column under O represents which value actually gets returned by `and` as well as the truthiness of it.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Left !! Right !! Output&lt;br /&gt;
|-&lt;br /&gt;
| False || False || False (Left)&lt;br /&gt;
|-&lt;br /&gt;
| False || True || False (Left)&lt;br /&gt;
|-&lt;br /&gt;
| True || False || False (Right)&lt;br /&gt;
|-&lt;br /&gt;
| True || True || True (Right)&lt;br /&gt;
|}&lt;br /&gt;
The reason this is so complex is because it doesn&#039;t just work on booleans. It works on all value types.&lt;br /&gt;
&lt;br /&gt;
===Logical Or (or)===&lt;br /&gt;
This operator operates on truthiness.&amp;lt;br&amp;gt;&lt;br /&gt;
If the leftSide is considered truthy, it returns the leftSide. Otherwise, it returns the rightSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This ends up with the return value being truthy either the leftSide &#039;&#039;or&#039;&#039; rightSide are truthy.&amp;lt;br&amp;gt;&lt;br /&gt;
The following table puts this visually. L is leftSide, R is rightSide. F and T represent if the value is falsy or truthy, and the column under O represents which value actually gets returned by `or` as well as the truthiness of it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Left !! Right !! Output&lt;br /&gt;
|-&lt;br /&gt;
| False || False || False (Right)&lt;br /&gt;
|-&lt;br /&gt;
| False || True || True (Right)&lt;br /&gt;
|-&lt;br /&gt;
| True || False || True (Left)&lt;br /&gt;
|-&lt;br /&gt;
| True || True || True (Left)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The reason this is so complex is because it doesn&#039;t just work on booleans. It works on all value types.&lt;br /&gt;
&lt;br /&gt;
===Logical Not (not)===&lt;br /&gt;
Only operates on the rightSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This operator evaluates the truthiness of the value, then returns the boolean representation of the opposite.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;not true&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;not 2&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;not false&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;not {}&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;not nil&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
All values can use this operator.&lt;br /&gt;
===String Concatenation (..)===&lt;br /&gt;
This returns a string from the values concatenated together.&amp;lt;br&amp;gt;&lt;br /&gt;
Only strings can use this operator.&lt;br /&gt;
===Length Operator (#)===&lt;br /&gt;
Only operates on the rightSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This returns the length of the value&amp;lt;br&amp;gt;&lt;br /&gt;
For strings, its the amount of bytes stored in the string. (UTF-8 characters are more than one byte)&amp;lt;br&amp;gt;&lt;br /&gt;
For tables, lua iterates over &amp;lt;code&amp;gt;t[1], t[2], t[3] ... t[n]&amp;lt;/code&amp;gt; until a nil value is found and returns the number of non-nil values found.&lt;br /&gt;
&lt;br /&gt;
==Control Statements==&lt;br /&gt;
Control Statements affect the scope and flow of the program. &lt;br /&gt;
===&amp;lt;code&amp;gt;if then end&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statements allow for executing code only when a condition is met.&lt;br /&gt;
&lt;br /&gt;
The basic structure looks like&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if condition then&lt;br /&gt;
    print(&amp;quot;condition is true&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statements have an optional &amp;lt;code&amp;gt;elseif&amp;lt;/code&amp;gt; clause, where if the previous condition failed this condition will be checked. In an &amp;lt;code&amp;gt;elseif&amp;lt;/code&amp;gt; chain, only the first successful condition will actually execute, after which all other &amp;lt;code&amp;gt;elseif&amp;lt;/code&amp;gt;s are ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if condition then&lt;br /&gt;
    print(&amp;quot;condition&amp;quot;)&lt;br /&gt;
elseif condition2 then&lt;br /&gt;
    print(&amp;quot;condition2&amp;quot;)&lt;br /&gt;
elseif condition3 then&lt;br /&gt;
    print(&amp;quot;condition3&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statements also have an optional &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; clause, where if &#039;&#039;all&#039;&#039; previous conditions fail, the &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; clause will execute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if condition then&lt;br /&gt;
    print(&amp;quot;condition&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    print(&amp;quot;not condition&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if condition then&lt;br /&gt;
    print(&amp;quot;condition&amp;quot;)&lt;br /&gt;
elseif condition2 then&lt;br /&gt;
    print(&amp;quot;condition2&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    print(&amp;quot;not condition or condition2&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; statements operate on [[#value_truthiness|Value Truthiness]]&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local rand = math.random()&amp;lt;0.3&lt;br /&gt;
-- Use booleans as raw input to if statements&lt;br /&gt;
-- the `==` operator just returns a boolean anyways and is just wasted instructions&lt;br /&gt;
if rand then&lt;br /&gt;
    print(&amp;quot;random print statement lol&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- getVehicle returns either an Entity userdata, or nil&lt;br /&gt;
local vehicle=player:getVehicle()&lt;br /&gt;
if vehicle then&lt;br /&gt;
    print(&amp;quot;Riding: &amp;quot;, vehicle:getName())&lt;br /&gt;
else&lt;br /&gt;
    print(&amp;quot;No Mount&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Loops===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
for i=1,10 do&lt;br /&gt;
    print(i)&lt;br /&gt;
end&lt;br /&gt;
--&amp;gt; 1,2,3,4,5,6,7,8,9,10&lt;br /&gt;
&lt;br /&gt;
local x = 1&lt;br /&gt;
while x &amp;lt; 10 do&lt;br /&gt;
    x = x + 1&lt;br /&gt;
    print(x)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--TODO this has been sitting locally for several months. I&#039;m uploading it and finishing it later&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Lua_Basics&amp;diff=545</id>
		<title>Lua Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Lua_Basics&amp;diff=545"/>
		<updated>2024-10-06T01:13:05Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Ported Katt&amp;#039;s Lua Basics page to MediaWiki and made a few minor edits.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
----&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=I highly recommend reading the [https://www.lua.org/manual/5.2/ Lua Reference] and [https://www.lua.org/pil/contents.html Programming in Lua] if you have the time. I provide a basic rundown of the most used functionality for Figura, but not everything gets covered.}}&lt;br /&gt;
&lt;br /&gt;
==How a computer reads code==&lt;br /&gt;
Code is basically just a list of instructions telling the computer step by step what to do. It is read line-by-line and the instructions are executed right away.&lt;br /&gt;
==Comments==&lt;br /&gt;
When there are 2 minus signs &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;, everything after it is ignored by Lua. These are called comments. They have no effect on the code that is executed and can be safely removed. Their primary purpose is to add raw text that can be used to aid in the understanding of code.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Comments are not compiled and do not affect code&lt;br /&gt;
local a = 2 -- Everything up to the next newline will be ignored.&lt;br /&gt;
-- Can also be used to hide code from the compiler without actually removing it:&lt;br /&gt;
-- local b = 4&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Another form of comment is &amp;lt;code&amp;gt;--[[  ]]&amp;lt;/code&amp;gt;. When this is used, everything between the square bracket pairs will be ignored. Newlines do not affect this. This type of comment is commonly referred to as a Long Comment.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 2&lt;br /&gt;
--[[ comment comment&lt;br /&gt;
ignores newlines &lt;br /&gt;
ignores pretty much everything&lt;br /&gt;
]] local b=2 --long comments end strictly at the `]]`&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
==Variables==&lt;br /&gt;
Variables store values. Lua is a dynamically typed language, meaning any variable can store a value of any type. You can define a variable using the `local` keyword. Local variables are accessible below the line they were declared, but will not breach their scope.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Most of the time, you will want to instantly assign a value to that variable. In lua, if you use `=` it will store the value on the right inside the variable on the left.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 2 -- the variable named &amp;quot;a&amp;quot; now stores the value 2&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
After a variable has been declared, you can assign a new value to it by using &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; again. Note that the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; keyword is only used when creating the variable for the first time.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 2&lt;br /&gt;
a = 4 -- the variable &amp;quot;a&amp;quot; now stores 4&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Multiple variables can be declared and assigned on one line.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a, b = 1, 2&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Variables are limited in what characters can be used as an identifier (variable name). Only letters, numbers, and `_` can be used in a valid identifier, and it cannot start with a number. None of Lua&#039;s keywords (&amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt;, etc.) can be used as a variable name.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a123&lt;br /&gt;
local _b&lt;br /&gt;
local KEKW&lt;br /&gt;
local 123A -- invalid. Starts with a number.&lt;br /&gt;
local has-water -- invalid. Uses character `-`&lt;br /&gt;
local and -- invalid. `and` is a lua keyword.&lt;br /&gt;
local local -- invalid. `local` is a lua keyword.&lt;br /&gt;
local _ -- This name specifically is used to denote throwaway variables in loops.&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
If you assign a value to a value to a variable that has not been declared using &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt;, you will create a &#039;&#039;global&#039;&#039; variable. Global variables are accessible from the entire Lua environment. This may seem like a good thing to the inexperienced, but because they are accessible anywhere it is common for users to make mistakes when they reuse global variables for other purposes and accidentally overwrite it.&amp;lt;br&amp;gt;&lt;br /&gt;
There is almost never a good reason for using global variables, so always stick to &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- c was not declared local beforehand,&lt;br /&gt;
-- meaning there is now the value `10` at global variable `c`&lt;br /&gt;
c = 10&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Variables can be used in place of values.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 2&lt;br /&gt;
print(a) --&amp;gt; prints `2` to the chat&lt;br /&gt;
a = a + a&lt;br /&gt;
print(a) --&amp;gt; prints `4` to the chat&lt;br /&gt;
a = a + a&lt;br /&gt;
print(a) --&amp;gt; prints `8` to the chat&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
When you try to use a variable that hasnt been assigned a value, the value `nil` will be returned.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a&lt;br /&gt;
print(a) --&amp;gt; nil&lt;br /&gt;
print(d) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
print(c) --&amp;gt; 10 (the global variable we declared earlier lol)&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
&lt;br /&gt;
A function contains code that can be executed by calling the function. This is useful if you want to use the same code multiple times and can make your code more structured.&lt;br /&gt;
&lt;br /&gt;
To define a function you use the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; keyword, then the name of the function and &amp;lt;code&amp;gt;()&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
Any code after it will be considered inside this function, until you tell Lua that the function is done here by using the &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; keyword. For better readability we indent the code inside the function using spaces or tabs.&amp;lt;br&amp;gt;&lt;br /&gt;
The print statement will not execute until the function is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function hello()&lt;br /&gt;
    print(&amp;quot;Hello function!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever you call a function by putting &amp;lt;code&amp;gt;()&amp;lt;/code&amp;gt; after the function name, all the code inside the function will run line by line first, before continuing with the rest of your code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
print(&amp;quot;Outside.&amp;quot;)&lt;br /&gt;
hello()&lt;br /&gt;
print(&amp;quot;Below hello.&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
This will output the following:&lt;br /&gt;
 Outside.&lt;br /&gt;
 Hello function!&lt;br /&gt;
 Below hello.&lt;br /&gt;
You can also give the function some values to work with by putting variable names inside the &amp;lt;code&amp;gt;()&amp;lt;/code&amp;gt;. These variables are called parameters. The function can also return a new value itself that is accessible from where the function is called. If no &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; is specified, the function returns &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; (see &amp;quot;Types&amp;quot; section below).&amp;lt;br&amp;gt;&lt;br /&gt;
Here is an example of a function that calculates the sum of two numbers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function sum(a,b)    -- parameters seperated by commas&lt;br /&gt;
    local s = a + b  -- calculate the sum&lt;br /&gt;
    return s         -- return the sum to be used by tha caller&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local var1 = 2&lt;br /&gt;
local var2 = 8&lt;br /&gt;
local var3 = sum(var1, var2) -- call the function and pass two variables. note that these do not have to be called a and b&lt;br /&gt;
print(var3) --&amp;gt; 10, as you might have noticed, `print` is also a function that takes a parameter&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Values==&lt;br /&gt;
Values represent some form of data.&amp;lt;br&amp;gt;&lt;br /&gt;
There are many types of values for storing different types of data.&lt;br /&gt;
&lt;br /&gt;
===boolean===&lt;br /&gt;
A boolean is a data type with 2 distinct values: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Most operators return a boolean and it&#039;s current state can be inverted with &amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = true&lt;br /&gt;
print(a) --&amp;gt; true&lt;br /&gt;
print(not a) --&amp;gt; false&lt;br /&gt;
a = not a -- a = false&lt;br /&gt;
print(a) --&amp;gt; false&lt;br /&gt;
print(not a) --&amp;gt; true&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===number===&lt;br /&gt;
A number is, well, a number.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers can use arithmetic operators.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 14&lt;br /&gt;
local b = 4&lt;br /&gt;
print(a+b) --&amp;gt; 18&lt;br /&gt;
print(a-b) --&amp;gt; 10&lt;br /&gt;
print(a*b) --&amp;gt; 56&lt;br /&gt;
print(a/b) --&amp;gt; 3.5&lt;br /&gt;
print(a%b) --&amp;gt; 2&lt;br /&gt;
local c = 3.1459&lt;br /&gt;
local d = math.pi&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===string===&lt;br /&gt;
A string is a sequence of characters.&amp;lt;br&amp;gt;&lt;br /&gt;
Mostly used for holding and manipulating text data.&lt;br /&gt;
&lt;br /&gt;
[https://www.lua.org/manual/5.2/manual.html#6.4 String functions] are accessible through the &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; global variable. All string values also contain these functions within themselves.&lt;br /&gt;
&lt;br /&gt;
Strings are defined by encasing text in double quotes (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) or single quotes (&amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
If you try to put a newline in a string, Lua will refuse and throw a syntax error. Newlines must be encoded into a string using other characters. Specifically &amp;lt;code&amp;gt;\n&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
If you need to have either a &amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; in a string and you cannot wrap the string in another quote type, you can escape the quote using &amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Long Strings are defined by encasing text in 2 square brackets (&amp;lt;code&amp;gt;[[]]&amp;lt;/code&amp;gt;). Long strings capture every single character between the pairs of square brackets including raw newlines.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local str = &amp;quot;foo&amp;quot;&lt;br /&gt;
print(str .. &amp;quot; bar&amp;quot;)                          --&amp;gt; foo bar&lt;br /&gt;
&lt;br /&gt;
local a = &amp;quot;This string has \&amp;quot;quotes\&amp;quot; in it.&amp;quot;&lt;br /&gt;
print(a)                                       --&amp;gt; This string has &amp;quot;quotes&amp;quot; in it.&lt;br /&gt;
&lt;br /&gt;
local b = &amp;quot;This will result in&lt;br /&gt;
a syntax error&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local c = &amp;quot;This \nwill \nnot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local d = [[neither &lt;br /&gt;
will &lt;br /&gt;
this]]&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===table===&lt;br /&gt;
A Lua table is a data structure that stores many values.&lt;br /&gt;
&lt;br /&gt;
Tables operate on key-value pairs. You give the table a key in the form of a value, and it returns a value.&amp;lt;br&amp;gt;&lt;br /&gt;
Assigning works the same way. Give the table a key, and assign a value to the table at that key.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Define an empty table&lt;br /&gt;
local tbl = {}&lt;br /&gt;
-- Store the value 23 in the table with the key 54&lt;br /&gt;
tbl[54] = 23&lt;br /&gt;
-- Store the value false in the table with the key &amp;quot;stringKey&amp;quot;&lt;br /&gt;
tbl[&amp;quot;stringKey&amp;quot;] = false&lt;br /&gt;
&lt;br /&gt;
-- variables can be inputted, using their value as the key.&lt;br /&gt;
-- For instance, let&#039;s use our global c (which, if you don&#039;t remember, was set to 10) from earlier.&lt;br /&gt;
tbl[c] = &amp;quot;123&amp;quot;&lt;br /&gt;
&lt;br /&gt;
tbl[67] = tbl[54]&lt;br /&gt;
&lt;br /&gt;
print(tbl[54]) --&amp;gt; 23&lt;br /&gt;
print(tbl[&amp;quot;stringKey&amp;quot;]) --&amp;gt; false&lt;br /&gt;
print(tbl[10]) --&amp;gt; &amp;quot;123&amp;quot;&lt;br /&gt;
print(tbl[67]) --&amp;gt; 23&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
If your key is a string, you can use a different way of indexing that is easier to do. Do note that only strings that abide by identifier rules can be used this way. If the string is not a valid identifier, use &amp;lt;code&amp;gt;[]&amp;lt;/code&amp;gt; indexing&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local data={}&lt;br /&gt;
data.name=&amp;quot;Chocolate&amp;quot;&lt;br /&gt;
data.amount=100&lt;br /&gt;
data.delicious=true&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Unlike other values which are passed around by value, tables are passed by reference.&amp;lt;br&amp;gt;&lt;br /&gt;
What this means is that when you create a table and assign it to a variable, then assign it to a different variable, you do not have 2 tables. You have 2 variables pointing to the same table.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = {}&lt;br /&gt;
local b = a&lt;br /&gt;
local c = {}&lt;br /&gt;
print(a) --&amp;gt; table4b8ab37d&lt;br /&gt;
print(b) --&amp;gt; table4b8ab37d&lt;br /&gt;
print(c) --&amp;gt; table82f1e9c2&lt;br /&gt;
-- table equality works on &amp;quot;is this the same table?&amp;quot;.&lt;br /&gt;
-- The values inside do not matter.&lt;br /&gt;
print(a == b) --&amp;gt; true&lt;br /&gt;
print(a == c) --&amp;gt; false&lt;br /&gt;
-- same table in memory.&lt;br /&gt;
a.reeee = 2&lt;br /&gt;
print(b.reeee) --&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===nil===&lt;br /&gt;
&amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; is commonly referred to as the absence of data.&amp;lt;br&amp;gt;&lt;br /&gt;
It is what is returned when no data is present.&lt;br /&gt;
&lt;br /&gt;
===function===&lt;br /&gt;
Yes, functions are also a type of variable.&lt;br /&gt;
&lt;br /&gt;
An alternative way to name a function to what we learned before is by assigning a function to a variable.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = function()&lt;br /&gt;
    print(&amp;quot;function was called&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is functionally the same thing as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function a()&lt;br /&gt;
    print(&amp;quot;function was called&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like tables, functions are passed by reference, and equality is based on &amp;quot;is this the same function?&amp;quot;. The actual contents of the function are not evaluated, so identical looking functions, while similar, are not equal.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a=print&lt;br /&gt;
print(a == print) --&amp;gt; true&lt;br /&gt;
&lt;br /&gt;
local b=function() end&lt;br /&gt;
local c=function() end&lt;br /&gt;
print(b == c) --&amp;gt; false&lt;br /&gt;
&lt;br /&gt;
c = b&lt;br /&gt;
print(b == c) --&amp;gt; true&lt;br /&gt;
&lt;br /&gt;
print(b()) --&amp;gt; nil, because b does not return anything&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since functions are just another value type, they can be used as arguments to other functions.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function do10(func)&lt;br /&gt;
    for i=1,10 do -- this just means &amp;quot;repeat 10 times&amp;quot; increasing the variable `i` every time&lt;br /&gt;
        func(i)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
do10(print) --&amp;gt; 1,2,3,4,5,6,7,8,9,10&lt;br /&gt;
do10(function(v)&lt;br /&gt;
    print(v*2)&lt;br /&gt;
end) --&amp;gt; 2,4,6,8,10,12,14,16,18,20&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
Functions have access to all variables defined above where the function gets defined. Variables below where the function is defined is considered &amp;quot;out of scope&amp;quot; of the function.&amp;lt;br&amp;gt;&lt;br /&gt;
If a variable is used that is not defined above the function, the global variable with that identifier will be used&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a = 10&lt;br /&gt;
local b = &amp;quot;string lol&amp;quot;&lt;br /&gt;
local function d()&lt;br /&gt;
    print(a)&lt;br /&gt;
    print(b)&lt;br /&gt;
    print(c) -- there is no `c` variable defined above here, so the global `c` will be used.&lt;br /&gt;
end&lt;br /&gt;
local c = 20&lt;br /&gt;
d()&lt;br /&gt;
--&amp;gt; 10&lt;br /&gt;
--&amp;gt; &amp;quot;string lol&amp;quot;&lt;br /&gt;
--&amp;gt; 10&lt;br /&gt;
-- If you forgot the countless times we&#039;ve used the global c through this entire page, c is still 10.&lt;br /&gt;
&lt;br /&gt;
local function e(b)&lt;br /&gt;
    print(a)&lt;br /&gt;
    print(b)    -- variable `b` is redefined as a function parameter, so the other `b` is scope gets overshadowed&lt;br /&gt;
    print(c)    -- There *is* a `c` variable within scope this time&lt;br /&gt;
end&lt;br /&gt;
e(&amp;quot;string kek&amp;quot;)&lt;br /&gt;
--&amp;gt; 10&lt;br /&gt;
--&amp;gt; &amp;quot;string kek&amp;quot;&lt;br /&gt;
--&amp;gt; 20&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
If a function is one of the values in a table, special syntax can be used to have the table itself be the first argument to the function. By indexing the function with colon (&amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;) Lua will put the table itself as the first argument.&lt;br /&gt;
&lt;br /&gt;
This is used heavily in Figura for many of its APIs. All objects of the same type share the exact same functions, differentiated only by the object placed in the first argument.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local tbl={}&lt;br /&gt;
tbl.key = function(t, a, b)&lt;br /&gt;
    t[a] = b&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
tbl:key(&amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- this is functionally equivalent&lt;br /&gt;
tbl.key(tbl, &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- You can also use `:` when creating functions. The implied `self` argument will be used to refer to the first argument&lt;br /&gt;
function tbl:key(a, b)&lt;br /&gt;
    self[a] = b&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===userdata===&lt;br /&gt;
Lua is commonly used when embedded in other software. In this case, it is embedded inside of Figura.&amp;lt;br&amp;gt;&lt;br /&gt;
userdata is the means of communicating with that software.&lt;br /&gt;
&lt;br /&gt;
userdata is basically data initialized in Figura that gets interpreted as a Lua value. They function most similar to tables in the fact that they are indexed the same way to receive values, mostly functions.&lt;br /&gt;
&lt;br /&gt;
This is why knowing when to use `:` to index userdata is important.&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- `models` is a value of type userdata. More specifically, it is a ModelPart created in Java and made accessible in Lua.&lt;br /&gt;
-- userdata commonly overrides what the print and tostring functions return to improve the ability to debug code.&lt;br /&gt;
print(models) --&amp;gt; models (ModelPart)&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
==Variable Scope==&lt;br /&gt;
A Variable&#039;s Scope is the area the variable is accessible from.&lt;br /&gt;
&lt;br /&gt;
A variable&#039;s scope begins when it is declared, and extends until the end of the current block.&amp;lt;br&amp;gt;&lt;br /&gt;
The scope of global variables is the Lua environment itself and will not clear until Lua itself is shut down.&lt;br /&gt;
&lt;br /&gt;
All [[#control_statements|control statements]] will create new scopes when used. Functions also create their on scope when declared&amp;lt;br&amp;gt;&lt;br /&gt;
The `do end` statement can be used to create scopes, and doesn&#039;t have any other functionality. I will be using it to showcase how scopes affect variables, as explaining it raw will not get the point across. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a=4&lt;br /&gt;
local b=8&lt;br /&gt;
do&lt;br /&gt;
    -- a and b are accessible here&lt;br /&gt;
    local c = 12&lt;br /&gt;
    -- a, b, and c are accessible here&lt;br /&gt;
    a = 16 -- variable `a` in the outer scope is now `16`&lt;br /&gt;
&lt;br /&gt;
    local b = 20 -- b in the other scope has been overshadowed by this variable. All future references to `b` will refer to this variable (until the end of the scope)&lt;br /&gt;
&lt;br /&gt;
    print(a,b,c,d) --&amp;gt; 16, 20, 12, nil&lt;br /&gt;
end&lt;br /&gt;
print(a,b,c,d) --&amp;gt; 16, 8, 10, nil&lt;br /&gt;
-- Global c is still 10.&lt;br /&gt;
&lt;br /&gt;
local e&lt;br /&gt;
do&lt;br /&gt;
    local f=0&lt;br /&gt;
&lt;br /&gt;
    -- interesting thing is that functions capture the current scope.&lt;br /&gt;
    -- Even if we leave the scope, the function remembers the upvalue `f` and will continue to use it even if the scope `f` belongs to ends&lt;br /&gt;
    -- oh yea `a` is overshadowed here too. But thats not as interesting.&lt;br /&gt;
    e=function(a)&lt;br /&gt;
        f=f+1&lt;br /&gt;
        print(f, a)&lt;br /&gt;
    end&lt;br /&gt;
    e()--&amp;gt; 1, nil&lt;br /&gt;
    e()--&amp;gt; 2, nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
e()    --&amp;gt; 3, nil&lt;br /&gt;
e(&amp;quot;a&amp;quot;) --&amp;gt; 4, &amp;quot;a&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
==Value Truthiness==&lt;br /&gt;
All values have an implicit truthiness when used in the context of a boolean.&lt;br /&gt;
&lt;br /&gt;
It&#039;s simple to remember: &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; are both considered &amp;quot;falsely&amp;quot;, and every other value is considered &amp;quot;truthy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Truthiness is used in control statements, see the section about it below.&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
Operators, similar functions, take 1 or 2 values and outputs a result.&amp;lt;br&amp;gt;&lt;br /&gt;
They commonly take the form &amp;lt;code&amp;gt;leftSide operator rightSide&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
I will continue to refer to the 2 values that operators operate on as &amp;lt;code&amp;gt;leftSide&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rightSide&amp;lt;/code&amp;gt; for the duration of this section.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Operators have a priority system. It is surprisingly intuitive, but can be forced by surrounding the code you want to guarantee execute first in brackets `()`. For the true priority list, check out the [https://www.lua.org/manual/5.2/manual.html#3.4.7 Lua Reference Manual].&lt;br /&gt;
&lt;br /&gt;
Do note that despite me saying that &amp;quot;Only x can use this operator&amp;quot;, tables and userdata types are always exempt from this rule. However, they must be explicitly written to support these operators, so most will not support it by default.&lt;br /&gt;
===Arithmetic Addition (+)===&lt;br /&gt;
Its addition. 1+1 returns 2. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Subtraction (-)===&lt;br /&gt;
Its subtraction. 2-3 returns -1. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Multiplication (*)===&lt;br /&gt;
Its multiplication. 2*4 returns 8. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Division (/)===&lt;br /&gt;
Its division. 5/2 returns 2.5. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Modulo (%)===&lt;br /&gt;
Division actually has 2 components. The whole component, and the remainder component.&amp;lt;br&amp;gt;&lt;br /&gt;
Modulo returns this remainder component after the division leftSide/rightSide is done.&amp;lt;br&amp;gt;&lt;br /&gt;
5%2 returns 1, because 2 goes into 5 2 whole times, 2*2=4, 5-4=1.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Exponentiation (^)===&lt;br /&gt;
Its exponents. 2^3 returns 8. Basic stuff.&amp;lt;br&amp;gt;&lt;br /&gt;
Only numbers can use this operator.&lt;br /&gt;
===Arithmetic Negation (-)===&lt;br /&gt;
Only operates on the rightSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This operator negates the number, similar to just adding a negative symbol in front of it.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local a= -2&lt;br /&gt;
a=-a&lt;br /&gt;
print(a) --&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
===Relational Equality (==)===&lt;br /&gt;
Returns `true` if both values are considered the same value, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
All values can use this operator.&lt;br /&gt;
===Relational Inequality (~=)===&lt;br /&gt;
Returns `false` if both values are considered the same value, `true` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
All values can use this operator.&lt;br /&gt;
===Relational Less Than (&amp;lt;)===&lt;br /&gt;
Returns `true` if the leftSide is considered less then the rightSide, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers compare as expected.&lt;br /&gt;
Strings compare using their ascii representations, comparing each character left to right until they are not equal. Then the operator is applied to those 2 character&#039;s ascii numbers and returned.&lt;br /&gt;
===Relational Greater Than (&amp;gt;)===&lt;br /&gt;
Returns `true` if the leftSide is considered greater then the rightSide, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers compare as expected.&lt;br /&gt;
Strings compare using their ascii representations, comparing each character left to right until they are not equal. Then the operator is applied to those 2 character&#039;s ascii numbers and returned.&lt;br /&gt;
===Relational Less Than or Equal To (&amp;lt;=)===&lt;br /&gt;
Returns `true` if the leftSide is considered less then or equal to the rightSide using equality operator rules, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers compare as expected.&lt;br /&gt;
Strings compare using their ascii representations, comparing each character left to right until they are not equal. Then the operator is applied to those 2 character&#039;s ascii numbers and returned.&lt;br /&gt;
===Relational Greater Than or Equal To (&amp;gt;=)===&lt;br /&gt;
Returns `true` if the leftSide is considered greater then or equal to the rightSide using equality operator rules, `false` otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
Numbers compare as expected.&lt;br /&gt;
Strings compare using their ascii representations, comparing each character left to right until they are not equal. Then the operator is applied to those 2 character&#039;s ascii numbers and returned.&lt;br /&gt;
===Logical And (and)===&lt;br /&gt;
This operator operates on truthiness.&amp;lt;br&amp;gt;&lt;br /&gt;
If the leftSide is considered truthy, it returns the rightSide. Otherwise, it returns the leftSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This ends up with the return value being truthy only if both leftSide &#039;&#039;and&#039;&#039; rightSide are truthy.&amp;lt;br&amp;gt;&lt;br /&gt;
The following table puts this visually. L is leftSide, R is rightSide. F and T represent if the value is falsy or truthy, and the column under O represents which value actually gets returned by `and` as well as the truthiness of it.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Left !! Right !! Output&lt;br /&gt;
|-&lt;br /&gt;
| False || False || False (Left)&lt;br /&gt;
|-&lt;br /&gt;
| False || True || False (Left)&lt;br /&gt;
|-&lt;br /&gt;
| True || False || False (Right)&lt;br /&gt;
|-&lt;br /&gt;
| True || True || True (Right)&lt;br /&gt;
|}&lt;br /&gt;
The reason this is so complex is because it doesn&#039;t just work on booleans. It works on all value types.&lt;br /&gt;
&lt;br /&gt;
===Logical Or (or)===&lt;br /&gt;
This operator operates on truthiness.&amp;lt;br&amp;gt;&lt;br /&gt;
If the leftSide is considered truthy, it returns the leftSide. Otherwise, it returns the rightSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This ends up with the return value being truthy either the leftSide &#039;&#039;or&#039;&#039; rightSide are truthy.&amp;lt;br&amp;gt;&lt;br /&gt;
The following table puts this visually. L is leftSide, R is rightSide. F and T represent if the value is falsy or truthy, and the column under O represents which value actually gets returned by `or` as well as the truthiness of it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Left !! Right !! Output&lt;br /&gt;
|-&lt;br /&gt;
| False || False || False (Right)&lt;br /&gt;
|-&lt;br /&gt;
| False || True || True (Right)&lt;br /&gt;
|-&lt;br /&gt;
| True || False || True (Left)&lt;br /&gt;
|-&lt;br /&gt;
| True || True || True (Left)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The reason this is so complex is because it doesn&#039;t just work on booleans. It works on all value types.&lt;br /&gt;
&lt;br /&gt;
===Logical Not (not)===&lt;br /&gt;
Only operates on the rightSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This operator evaluates the truthiness of the value, then returns the boolean representation of the opposite.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;not true&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;not 2&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;not false&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;not {}&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;not nil&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
All values can use this operator.&lt;br /&gt;
===String Concatenation (..)===&lt;br /&gt;
This returns a string from the values concatenated together.&amp;lt;br&amp;gt;&lt;br /&gt;
Only strings can use this operator.&lt;br /&gt;
===Length Operator (#)===&lt;br /&gt;
Only operates on the rightSide.&amp;lt;br&amp;gt;&lt;br /&gt;
This returns the length of the value&amp;lt;br&amp;gt;&lt;br /&gt;
For strings, its the amount of bytes stored in the string. (UTF-8 characters are more than one byte)&amp;lt;br&amp;gt;&lt;br /&gt;
For tables, lua iterates over &amp;lt;code&amp;gt;t[1], t[2], t[3] ... t[n]&amp;lt;/code&amp;gt; until a nil value is found and returns the number of non-nil values found.&lt;br /&gt;
&lt;br /&gt;
==Control Statements==&lt;br /&gt;
Control Statements affect the scope and flow of the program. &lt;br /&gt;
===&amp;lt;code&amp;gt;if then end&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statements allow for executing code only when a condition is met.&lt;br /&gt;
&lt;br /&gt;
The basic structure looks like&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if condition then&lt;br /&gt;
    print(&amp;quot;condition is true&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statements have an optional &amp;lt;code&amp;gt;elseif&amp;lt;/code&amp;gt; clause, where if the previous condition failed this condition will be checked. In an &amp;lt;code&amp;gt;elseif&amp;lt;/code&amp;gt; chain, only the first successful condition will actually execute, after which all other &amp;lt;code&amp;gt;elseif&amp;lt;/code&amp;gt;s are ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if condition then&lt;br /&gt;
    print(&amp;quot;condition&amp;quot;)&lt;br /&gt;
elseif condition2 then&lt;br /&gt;
    print(&amp;quot;condition2&amp;quot;)&lt;br /&gt;
elseif condition3 then&lt;br /&gt;
    print(&amp;quot;condition3&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statements also have an optional &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; clause, where if &#039;&#039;all&#039;&#039; previous conditions fail, the &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; clause will execute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if condition then&lt;br /&gt;
    print(&amp;quot;condition&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    print(&amp;quot;not condition&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if condition then&lt;br /&gt;
    print(&amp;quot;condition&amp;quot;)&lt;br /&gt;
elseif condition2 then&lt;br /&gt;
    print(&amp;quot;condition2&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    print(&amp;quot;not condition or condition2&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; statements operate on [[#value_truthiness|Value Truthiness]]&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local rand = math.random()&amp;lt;0.3&lt;br /&gt;
-- Use booleans as raw input to if statements&lt;br /&gt;
-- the `==` operator just returns a boolean anyways and is just wasted instructions&lt;br /&gt;
if rand then&lt;br /&gt;
    print(&amp;quot;random print statement lol&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- getVehicle returns either an Entity userdata, or nil&lt;br /&gt;
local vehicle=player:getVehicle()&lt;br /&gt;
if vehicle then&lt;br /&gt;
    print(&amp;quot;Riding: &amp;quot;, vehicle:getName())&lt;br /&gt;
else&lt;br /&gt;
    print(&amp;quot;No Mount&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Loops===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
for i=1,10 do&lt;br /&gt;
    print(i)&lt;br /&gt;
end&lt;br /&gt;
--&amp;gt; 1,2,3,4,5,6,7,8,9,10&lt;br /&gt;
&lt;br /&gt;
local x = 1&lt;br /&gt;
while x &amp;lt; 10 do&lt;br /&gt;
    x = x + 1&lt;br /&gt;
    print(x)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--TODO this has been sitting locally for several months. I&#039;m uploading it and finishing it later&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=544</id>
		<title>Community Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=544"/>
		<updated>2024-10-05T23:37:15Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Removed Squishy API from Community Resources because Wiki team decided on that on Sept. 25, 2024&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is heavily unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Please wait before referring other people to this page. If you&#039;re able to, please [[FiguraMC:Contributing|contribute]]!&lt;br /&gt;
}}&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some of the resources listed here are not officially endorsed by FiguraMC.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Resources affiliated with FiguraMC will be marked as such with a ⭐ icon.&lt;br /&gt;
}}&lt;br /&gt;
= Documentation =&lt;br /&gt;
===[https://applejuiceyy.github.io/figs/ Figs]===&lt;br /&gt;
&#039;&#039;&#039;Figs&#039;&#039;&#039; is an online documentation browser for Figura, making using Figura&#039;s built-in documentation easier to use.&lt;br /&gt;
===[https://wiki.figuramc.org Figura Wiki] (YOU ARE HERE) ⭐===&lt;br /&gt;
The &#039;&#039;&#039;Figura Wiki&#039;&#039;&#039; is an online wiki that aims to document Figura, its scripting language, modeling, etc.&lt;br /&gt;
== Lua Documenation ==&lt;br /&gt;
===[https://manuel-3.github.io/lua-quickstart Lua Quickstart Guide]===&lt;br /&gt;
&#039;&#039;&#039;Manuel&#039;s Lua Quickstart Guide&#039;&#039;&#039; is a quick, online tutorial guiding users through the basics of Lua syntax.&lt;br /&gt;
===[http://lua.org/manual/5.1 Lua 5.1 Manual]===&lt;br /&gt;
The &#039;&#039;&#039;Lua Manual&#039;&#039;&#039; is a long document describing the ins and outs of vanilla Lua. Although some of it will not apply to Figura Lua, it&#039;s still very useful for learning about the standard libraries.&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
===[https://www.youtube.com/playlist?list=PLNz7v2g2SFA8lOQUDS4z4-gIDLi_dWAhl Chloe&#039;s Video Tutorial Series]===&lt;br /&gt;
&#039;&#039;&#039;Chloe&#039;s Tutorial Series&#039;&#039;&#039; is a video series on YouTube that acts as a way for new users to get used to the mod. The series covers everything from modeling and modifying &amp;lt;code&amp;gt;avatar.json&amp;lt;/code&amp;gt; files to scripting.&lt;br /&gt;
= Tools =&lt;br /&gt;
===[https://github.com/GrandpaScout/FiguraRewriteVSDocs GS&#039; Figura VSCode Documentation]===&lt;br /&gt;
&#039;&#039;&#039;GrandpaScout&#039;s Figura VSCode Documentation&#039;&#039;&#039; is an addon for Visual Studio Code (along with Code OSS and VSCodium) that adds Figura&#039;s documentation and snippets to [https://marketplace.visualstudio.com/items?itemName=sumneko.lua sumneko&#039;s Lua Language Server plugin].&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/GrandpaScout/FiguraRewriteVSDocs/wiki Install Guide]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/KitCat962/figura-format-bbplugin Katt&#039;s Figura Blockbench Extension]===&lt;br /&gt;
The &#039;&#039;&#039;Figura Blockbench Extension&#039;&#039;&#039; adds a new model format to Blockbench, the Figura Model format. It extends the base Generic Model format by adding tools to make the avatar creation process easier, lifting restrictions to the Generic Model format that Figura supports, and removing features Figura doesn&#039;t.&lt;br /&gt;
= Assets (Scripts, Libraries, APIs) =&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some assets only exist within the [https://discord.figuramc.org FiguraMC Discord].&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Assets that link to the FiguraMC Discord will be marked with a 💬 icon.&lt;br /&gt;
}}&lt;br /&gt;
== Script Helpers ==&lt;br /&gt;
===[https://github.com/Manuel-3/figura-scripts/tree/main/src/runLater Run Later]===&lt;br /&gt;
&#039;&#039;&#039;Run Later&#039;&#039;&#039; is a script that allows users to run code after a set amount of time or after a condition is met, similar to a wait/sleep/halt instruction except it runs a function after the wait instead of the rest of the code.&lt;br /&gt;
== Animation Helpers ==&lt;br /&gt;
===[https://github.com/GrandpaScout/GSAnimBlend GSAnimBlend]===&lt;br /&gt;
&#039;&#039;&#039;GSAnimBlend&#039;&#039;&#039; is a script that automatically adds blends to the start and end of animations.&lt;br /&gt;
===[https://github.com/JimmyHelp/JimmyAnims Jimmy&#039;s Animation Handler]===&lt;br /&gt;
&#039;&#039;&#039;JimmyAnim&#039;&#039;&#039; (full name Jimmy&#039;s Animation Helper) is a library that plays specific Blockbench animations based on the player&#039;s current action.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://jimmyhelp.notion.site/JimmyAnims-79adfdca2fe04f9c9ede5e0bfd898b6a Documentation]&lt;br /&gt;
* [https://github.com/JimmyHelp/JimmyAnims/blob/main/JimmyExample.lua Example Usage]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
== World Interactions==&lt;br /&gt;
===[https://discord.com/channels/1129805506354085959/1132467393050968214/1132467393050968214 Origins API] 💬===&lt;br /&gt;
Katt&#039;s &#039;&#039;&#039;Origins API&#039;&#039;&#039; is an API that uses the player&#039;s NBT data to get information about the player&#039;s [https://modrinth.com/mod/origins Origin].&lt;br /&gt;
===[https://github.com/GrandpaScout/GSServerNet GSServerNet]===&lt;br /&gt;
&#039;&#039;&#039;GSServerNet&#039;&#039;&#039; allows Figura to communicate with the server/world the player is in using a companion datapack.&lt;br /&gt;
==Visual Elements==&lt;br /&gt;
===[https://github.com/Manuel-3/figura-scripts/tree/main/src/confetti Confetti]===&lt;br /&gt;
&#039;&#039;&#039;Confetti&#039;&#039;&#039; is a library that allows users to add custom particles, either sprite or modelpart, to their avatars&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/readme.md Documentation]&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/example.zip Example Avatar]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://discord.com/channels/1129805506354085959/1137506926742216835 KattArmor] 💬===&lt;br /&gt;
&#039;&#039;&#039;KattArmor&#039;&#039;&#039; (sometimes called Katt Armor API/Library) is a library that allows users to edit their avatar&#039;s armor, whether by adding pivots using a script or by using unique models and textures.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://discord.com/channels/1129805506354085959/1137506926742216835/1155212562980425818 How-To Guide]&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1262160359905562705 Example Avatars]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/MitchOfTarcoola/MOARArmsAPI MOAR Arms API]===&lt;br /&gt;
&#039;&#039;&#039;MOAR Arms API&#039;&#039;&#039; is a library that makes making an avatar with multiple arms easier, allowing an avatar to appear to hold more than two items at once.&lt;br /&gt;
===[https://github.com/lua-gods/figuraLibraries/tree/main/tail%20and%20ears Tail and Ears Physics]===&lt;br /&gt;
&#039;&#039;&#039;Tail and Ears Physics&#039;&#039;&#039; is a script that gives physics to a set of ears and multiple parts of a tail.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/lua-gods/figuraLibraries/blob/main/tail%20and%20ears/examples.lua Example Usage]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/lua-gods/figuraLibraries/blob/main/plushie/plushie.lua Plushie]===&lt;br /&gt;
&#039;&#039;&#039;Plushie&#039;&#039;&#039; snaps a skull model (specified in the config) to the floor below it and scales the model based on the amount above it.&lt;br /&gt;
&lt;br /&gt;
= Community =&lt;br /&gt;
===[https://discord.figuramc.org FiguraMC Discord] ⭐===&lt;br /&gt;
The &#039;&#039;&#039;FiguraMC Discord Server&#039;&#039;&#039; is the central place for everything Figura, including help and support for the mod, avatar showcasing, and more. You&#039;ll also need to join this server to request whitelist to the FiguraSMP.&lt;br /&gt;
== Minecraft Servers ==&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some servers listed below are whitelisted.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Servers that have a public whitelist application process will be marked with a 🔒 icon.&lt;br /&gt;
* Servers that are invite-only will be marked with a 🛡️ icon.&lt;br /&gt;
}}&lt;br /&gt;
=== Figura Plaza ⭐ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;plaza.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version: 1.16.5 - 1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; is an official lobby-like server where players can join, hang out with other Figura users, make avatars in company, play games, and occasionally attend events. The server does not have any survival gameplay, and disables PvP by default. The server also provides a selection of free temporary items to use when testing avatars.&lt;br /&gt;
&lt;br /&gt;
=== Figura SMP ⭐🔒 ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;vanilla.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura SMP&#039;&#039;&#039; (also referred to as Vanilla SMP) is an official survial server that stays close to the base game, plus a few server-side mods for quality-of-life purposes. You are perfectly able to join this server without any mods, and even on a vanilla client. You can read the server rules in the [https://discord.figuramc.org FiguraMC Discord Server]&#039;s [https://discord.com/channels/1129805506354085959/1130186794873405510 #info] channel and get whitelisted by putting your name in [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist].&lt;br /&gt;
&lt;br /&gt;
==== Modded SMP ====&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1-fabric&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Modpack:&amp;amp;nbsp;&amp;lt;span style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Modded SMP&#039;&#039;&#039; is a seasonal modpack server adjacent to Figura SMP, each season coming with its own theme. &#039;&#039;&#039;Currently offline.&#039;&#039;&#039; The next season is themed after a nuclear apocalypse and is set for release Soon™. The ModdedSMP shares a whitelist with the VanillaSMP, meaning that [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist] will whitelist you for both servers.&lt;br /&gt;
&lt;br /&gt;
=== 4p5.nz 🛡️ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;4p5.nz&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; is an invite-only creative/operator server where players have free reign over the world around them.&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Sandbox&amp;diff=543</id>
		<title>User:Slyme/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Sandbox&amp;diff=543"/>
		<updated>2024-10-05T23:27:25Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=542</id>
		<title>Community Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=542"/>
		<updated>2024-10-05T22:48:43Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Added the rest of the Community Spotlight assets and converted collapsibles to the template.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is heavily unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Please wait before referring other people to this page. If you&#039;re able to, please [[FiguraMC:Contributing|contribute]]!&lt;br /&gt;
}}&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some of the resources listed here are not officially endorsed by FiguraMC.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Resources affiliated with FiguraMC will be marked as such with a ⭐ icon.&lt;br /&gt;
}}&lt;br /&gt;
= Documentation =&lt;br /&gt;
===[https://applejuiceyy.github.io/figs/ Figs]===&lt;br /&gt;
&#039;&#039;&#039;Figs&#039;&#039;&#039; is an online documentation browser for Figura, making using Figura&#039;s built-in documentation easier to use.&lt;br /&gt;
===[https://wiki.figuramc.org Figura Wiki] (YOU ARE HERE) ⭐===&lt;br /&gt;
The &#039;&#039;&#039;Figura Wiki&#039;&#039;&#039; is an online wiki that aims to document Figura, its scripting language, modeling, etc.&lt;br /&gt;
== Lua Documenation ==&lt;br /&gt;
===[https://manuel-3.github.io/lua-quickstart Lua Quickstart Guide]===&lt;br /&gt;
&#039;&#039;&#039;Manuel&#039;s Lua Quickstart Guide&#039;&#039;&#039; is a quick, online tutorial guiding users through the basics of Lua syntax.&lt;br /&gt;
===[http://lua.org/manual/5.1 Lua 5.1 Manual]===&lt;br /&gt;
The &#039;&#039;&#039;Lua Manual&#039;&#039;&#039; is a long document describing the ins and outs of vanilla Lua. Although some of it will not apply to Figura Lua, it&#039;s still very useful for learning about the standard libraries.&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
===[https://www.youtube.com/playlist?list=PLNz7v2g2SFA8lOQUDS4z4-gIDLi_dWAhl Chloe&#039;s Video Tutorial Series]===&lt;br /&gt;
&#039;&#039;&#039;Chloe&#039;s Tutorial Series&#039;&#039;&#039; is a video series on YouTube that acts as a way for new users to get used to the mod. The series covers everything from modeling and modifying &amp;lt;code&amp;gt;avatar.json&amp;lt;/code&amp;gt; files to scripting.&lt;br /&gt;
= Tools =&lt;br /&gt;
===[https://github.com/GrandpaScout/FiguraRewriteVSDocs GS&#039; Figura VSCode Documentation]===&lt;br /&gt;
&#039;&#039;&#039;GrandpaScout&#039;s Figura VSCode Documentation&#039;&#039;&#039; is an addon for Visual Studio Code (along with Code OSS and VSCodium) that adds Figura&#039;s documentation and snippets to [https://marketplace.visualstudio.com/items?itemName=sumneko.lua sumneko&#039;s Lua Language Server plugin].&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/GrandpaScout/FiguraRewriteVSDocs/wiki Install Guide]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/KitCat962/figura-format-bbplugin Katt&#039;s Figura Blockbench Extension]===&lt;br /&gt;
The &#039;&#039;&#039;Figura Blockbench Extension&#039;&#039;&#039; adds a new model format to Blockbench, the Figura Model format. It extends the base Generic Model format by adding tools to make the avatar creation process easier, lifting restrictions to the Generic Model format that Figura supports, and removing features Figura doesn&#039;t.&lt;br /&gt;
= Assets (Scripts, Libraries, APIs) =&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some assets only exist within the [https://discord.figuramc.org FiguraMC Discord].&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Assets that link to the FiguraMC Discord will be marked with a 💬 icon.&lt;br /&gt;
}}&lt;br /&gt;
== Script Helpers ==&lt;br /&gt;
===[https://github.com/Manuel-3/figura-scripts/tree/main/src/runLater Run Later]===&lt;br /&gt;
&#039;&#039;&#039;Run Later&#039;&#039;&#039; is a script that allows users to run code after a set amount of time or after a condition is met, similar to a wait/sleep/halt instruction except it runs a function after the wait instead of the rest of the code.&lt;br /&gt;
== Animation Helpers ==&lt;br /&gt;
===[https://github.com/GrandpaScout/GSAnimBlend GSAnimBlend]===&lt;br /&gt;
&#039;&#039;&#039;GSAnimBlend&#039;&#039;&#039; is a script that automatically adds blends to the start and end of animations.&lt;br /&gt;
===[https://github.com/JimmyHelp/JimmyAnims Jimmy&#039;s Animation Handler]===&lt;br /&gt;
&#039;&#039;&#039;JimmyAnim&#039;&#039;&#039; (full name Jimmy&#039;s Animation Helper) is a library that plays specific Blockbench animations based on the player&#039;s current action.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://jimmyhelp.notion.site/JimmyAnims-79adfdca2fe04f9c9ede5e0bfd898b6a Documentation]&lt;br /&gt;
* [https://github.com/JimmyHelp/JimmyAnims/blob/main/JimmyExample.lua Example Usage]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
== World Interactions==&lt;br /&gt;
===[https://discord.com/channels/1129805506354085959/1132467393050968214/1132467393050968214 Origins API] 💬===&lt;br /&gt;
Katt&#039;s &#039;&#039;&#039;Origins API&#039;&#039;&#039; is an API that uses the player&#039;s NBT data to get information about the player&#039;s [https://modrinth.com/mod/origins Origin].&lt;br /&gt;
===[https://github.com/GrandpaScout/GSServerNet GSServerNet]===&lt;br /&gt;
&#039;&#039;&#039;GSServerNet&#039;&#039;&#039; allows Figura to communicate with the server/world the player is in using a companion datapack.&lt;br /&gt;
==Visual Elements==&lt;br /&gt;
===[https://github.com/Manuel-3/figura-scripts/tree/main/src/confetti Confetti]===&lt;br /&gt;
&#039;&#039;&#039;Confetti&#039;&#039;&#039; is a library that allows users to add custom particles, either sprite or modelpart, to their avatars&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/readme.md Documentation]&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/example.zip Example Avatar]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://discord.com/channels/1129805506354085959/1137506926742216835 KattArmor] 💬===&lt;br /&gt;
&#039;&#039;&#039;KattArmor&#039;&#039;&#039; (sometimes called Katt Armor API/Library) is a library that allows users to edit their avatar&#039;s armor, whether by adding pivots using a script or by using unique models and textures.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://discord.com/channels/1129805506354085959/1137506926742216835/1155212562980425818 How-To Guide]&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1262160359905562705 Example Avatars]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/MrSirSquishy/SquishyAPI Squishy API]===&lt;br /&gt;
&#039;&#039;&#039;Squishy API&#039;&#039;&#039; (sometimes called SquAPI) is a library that provides many useful features to avatar creators, including physics, eye movement, etc.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://mrsirsquishy.notion.site/Squishy-API-Guide-3e72692e93a248b5bd88353c96d8e6c5 Documentation]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/MitchOfTarcoola/MOARArmsAPI MOAR Arms API]===&lt;br /&gt;
&#039;&#039;&#039;MOAR Arms API&#039;&#039;&#039; is a library that makes making an avatar with multiple arms easier, allowing an avatar to appear to hold more than two items at once.&lt;br /&gt;
===[https://github.com/lua-gods/figuraLibraries/tree/main/tail%20and%20ears Tail and Ears Physics]===&lt;br /&gt;
&#039;&#039;&#039;Tail and Ears Physics&#039;&#039;&#039; is a script that gives physics to a set of ears and multiple parts of a tail.&lt;br /&gt;
{{Collapsible&lt;br /&gt;
 |content=* [https://github.com/lua-gods/figuraLibraries/blob/main/tail%20and%20ears/examples.lua Example Usage]&lt;br /&gt;
 |label=Additional Resources&lt;br /&gt;
}}&lt;br /&gt;
===[https://github.com/lua-gods/figuraLibraries/blob/main/plushie/plushie.lua Plushie]===&lt;br /&gt;
&#039;&#039;&#039;Plushie&#039;&#039;&#039; snaps a skull model (specified in the config) to the floor below it and scales the model based on the amount above it.&lt;br /&gt;
= Community =&lt;br /&gt;
===[https://discord.figuramc.org FiguraMC Discord] ⭐===&lt;br /&gt;
The &#039;&#039;&#039;FiguraMC Discord Server&#039;&#039;&#039; is the central place for everything Figura, including help and support for the mod, avatar showcasing, and more. You&#039;ll also need to join this server to request whitelist to the FiguraSMP.&lt;br /&gt;
== Minecraft Servers ==&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some servers listed below are whitelisted.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Servers that have a public whitelist application process will be marked with a 🔒 icon.&lt;br /&gt;
* Servers that are invite-only will be marked with a 🛡️ icon.&lt;br /&gt;
}}&lt;br /&gt;
=== Figura Plaza ⭐ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;plaza.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version: 1.16.5 - 1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; is an official lobby-like server where players can join, hang out with other Figura users, make avatars in company, play games, and occasionally attend events. The server does not have any survival gameplay, and disables PvP by default. The server also provides a selection of free temporary items to use when testing avatars.&lt;br /&gt;
&lt;br /&gt;
=== Figura SMP ⭐🔒 ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;vanilla.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura SMP&#039;&#039;&#039; (also referred to as Vanilla SMP) is an official survial server that stays close to the base game, plus a few server-side mods for quality-of-life purposes. You are perfectly able to join this server without any mods, and even on a vanilla client. You can read the server rules in the [https://discord.figuramc.org FiguraMC Discord Server]&#039;s [https://discord.com/channels/1129805506354085959/1130186794873405510 #info] channel and get whitelisted by putting your name in [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist].&lt;br /&gt;
&lt;br /&gt;
==== Modded SMP ====&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1-fabric&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Modpack:&amp;amp;nbsp;&amp;lt;span style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Modded SMP&#039;&#039;&#039; is a seasonal modpack server adjacent to Figura SMP, each season coming with its own theme. &#039;&#039;&#039;Currently offline.&#039;&#039;&#039; The next season is themed after a nuclear apocalypse and is set for release Soon™. The ModdedSMP shares a whitelist with the VanillaSMP, meaning that [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist] will whitelist you for both servers.&lt;br /&gt;
&lt;br /&gt;
=== 4p5.nz 🛡️ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;4p5.nz&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; is an invite-only creative/operator server where players have free reign over the world around them.&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Collapsible&amp;diff=541</id>
		<title>Template:Collapsible</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Collapsible&amp;diff=541"/>
		<updated>2024-10-05T22:34:04Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-heading4&amp;quot;&amp;gt;{{{2|{{{label|See more}}}}}}&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{{1|{{{content}}}}}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;label&amp;quot;: {&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;2&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Label&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: false,&lt;br /&gt;
            &amp;quot;description&amp;quot;: &amp;quot;The header above the content, shown even if collapsed.&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;content&amp;quot;: {&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;1&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Content&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;The content of the collapsible.&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;paramOrder&amp;quot;: [&lt;br /&gt;
		&amp;quot;content&amp;quot;,&lt;br /&gt;
		&amp;quot;label&amp;quot;&lt;br /&gt;
	]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Template:Collapsible&amp;diff=540</id>
		<title>Template:Collapsible</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Template:Collapsible&amp;diff=540"/>
		<updated>2024-10-05T22:26:38Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Created page with &amp;quot;&amp;lt;templatestyles src=&amp;quot;Template:Notice/style.css&amp;quot;/&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt; &amp;lt;div class=&amp;quot;mw-heading4&amp;quot;&amp;gt;{{{2|{{{label|See more}}}}}} &amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;/div&amp;gt; &amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt; {{{1|{{{content}}}}}} &amp;lt;/div&amp;gt; &amp;lt;/div&amp;gt;&amp;lt;noinclude&amp;gt; &amp;lt;templatedata&amp;gt; { 	&amp;quot;params&amp;quot;: { 		&amp;quot;label&amp;quot;: { 			&amp;quot;aliases&amp;quot;: [ 				&amp;quot;2&amp;quot; 			], 			&amp;quot;label&amp;quot;: &amp;quot;Label&amp;quot;, 			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, 			&amp;quot;required&amp;quot;: false,             &amp;quot;description&amp;quot;: &amp;quot;The header above th...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;templatestyles src=&amp;quot;Template:Notice/style.css&amp;quot;/&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-heading4&amp;quot;&amp;gt;{{{2|{{{label|See more}}}}}}&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{{1|{{{content}}}}}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;label&amp;quot;: {&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;2&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Label&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: false,&lt;br /&gt;
            &amp;quot;description&amp;quot;: &amp;quot;The header above the content, shown even if collapsed.&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;content&amp;quot;: {&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;1&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Content&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;The content of the collapsible.&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;paramOrder&amp;quot;: [&lt;br /&gt;
		&amp;quot;content&amp;quot;,&lt;br /&gt;
		&amp;quot;label&amp;quot;&lt;br /&gt;
	]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Sandbox&amp;diff=537</id>
		<title>User:Slyme/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Sandbox&amp;diff=537"/>
		<updated>2024-10-05T22:13:23Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-heading2&amp;quot;&amp;gt;HelloWorld&amp;lt;/div&amp;gt;&lt;br /&gt;
foo bar&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme/Sandbox&amp;diff=536</id>
		<title>User:Slyme/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme/Sandbox&amp;diff=536"/>
		<updated>2024-10-05T22:12:52Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Created page with &amp;quot;==Test== foo bar ==Test== foo bar ==Test== foo bar ==Test== foo bar ==Test== foo bar ==Test== foo bar ==Test== foo bar ==Test== foo bar ==Test== foo bar&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;br /&gt;
==Test==&lt;br /&gt;
foo bar&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=535</id>
		<title>Community Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=535"/>
		<updated>2024-10-05T20:46:13Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Unfuck the sidebar v2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is heavily unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Please wait before referring other people to this page. If you&#039;re able to, please [[FiguraMC:Contributing|contribute]]!&lt;br /&gt;
}}&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some of the resources listed here are not officially endorsed by FiguraMC.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Resources affiliated with FiguraMC will be marked as such with a ⭐ icon.&lt;br /&gt;
}}&lt;br /&gt;
= Documentation =&lt;br /&gt;
===[https://applejuiceyy.github.io/figs/ Figs]===&lt;br /&gt;
&#039;&#039;&#039;Figs&#039;&#039;&#039; is an online documentation browser for Figura, making using Figura&#039;s built-in documentation easier to use.&lt;br /&gt;
===[https://wiki.figuramc.org Figura Wiki] (YOU ARE HERE) ⭐===&lt;br /&gt;
The &#039;&#039;&#039;Figura Wiki&#039;&#039;&#039; is an online wiki that aims to document Figura, its scripting language, modeling, etc.&lt;br /&gt;
== Lua Documenation ==&lt;br /&gt;
===[https://manuel-3.github.io/lua-quickstart Lua Quickstart Guide]===&lt;br /&gt;
&#039;&#039;&#039;Manuel&#039;s Lua Quickstart Guide&#039;&#039;&#039; is a quick, online tutorial guiding users through the basics of Lua syntax.&lt;br /&gt;
===[http://lua.org/manual/5.1 Lua 5.1 Manual]===&lt;br /&gt;
The &#039;&#039;&#039;Lua Manual&#039;&#039;&#039; is a long document describing the ins and outs of vanilla Lua. Although some of it will not apply to Figura Lua, it&#039;s still very useful for learning about the standard libraries.&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
===[https://www.youtube.com/playlist?list=PLNz7v2g2SFA8lOQUDS4z4-gIDLi_dWAhl Chloe&#039;s Video Tutorial Series]===&lt;br /&gt;
&#039;&#039;&#039;Chloe&#039;s Tutorial Series&#039;&#039;&#039; is a video series on YouTube that acts as a way for new users to get used to the mod. The series covers everything from modeling and modifying &amp;lt;code&amp;gt;avatar.json&amp;lt;/code&amp;gt; files to scripting.&lt;br /&gt;
= Tools =&lt;br /&gt;
===[https://github.com/GrandpaScout/FiguraRewriteVSDocs GS&#039; Figura VSCode Documentation]===&lt;br /&gt;
&#039;&#039;&#039;GrandpaScout&#039;s Figura VSCode Documentation&#039;&#039;&#039; is an addon for Visual Studio Code (along with Code OSS and VSCodium) that adds Figura&#039;s documentation and snippets to [https://marketplace.visualstudio.com/items?itemName=sumneko.lua sumneko&#039;s Lua Language Server plugin].&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://github.com/GrandpaScout/FiguraRewriteVSDocs/wiki Install Guide]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===[https://github.com/KitCat962/figura-format-bbplugin Katt&#039;s Figura Blockbench Extension]===&lt;br /&gt;
The &#039;&#039;&#039;Figura Blockbench Extension&#039;&#039;&#039; adds a new model format to Blockbench, the Figura Model format. It extends the base Generic Model format by adding tools to make the avatar creation process easier, lifting restrictions to the Generic Model format that Figura supports, and removing features Figura doesn&#039;t.&lt;br /&gt;
= Assets (Scripts, Libraries, APIs) =&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some assets only exist within the [https://discord.figuramc.org FiguraMC Discord].&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Assets that link to the FiguraMC Discord will be marked with a 💬 icon.&lt;br /&gt;
}}&lt;br /&gt;
== Animation Helpers ==&lt;br /&gt;
===[https://github.com/GrandpaScout/GSAnimBlend GSAnimBlend]===&lt;br /&gt;
&#039;&#039;&#039;GSAnimBlend&#039;&#039;&#039; is a script that automatically adds blends to the start and end of animations.&lt;br /&gt;
===[https://github.com/JimmyHelp/JimmyAnims Jimmy&#039;s Animation Handler]===&lt;br /&gt;
&#039;&#039;&#039;JimmyAnim&#039;&#039;&#039; (full name Jimmy&#039;s Animation Helper) is a library that plays specific Blockbench animations based on the player&#039;s current action.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://jimmyhelp.notion.site/JimmyAnims-79adfdca2fe04f9c9ede5e0bfd898b6a Documentation]&lt;br /&gt;
* [https://github.com/JimmyHelp/JimmyAnims/blob/main/JimmyExample.lua Example Usage]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== World Interactions==&lt;br /&gt;
===[https://discord.com/channels/1129805506354085959/1132467393050968214/1132467393050968214 Origins API] 💬===&lt;br /&gt;
Katt&#039;s &#039;&#039;&#039;Origins API&#039;&#039;&#039; is an API that uses the player&#039;s NBT data to get information about the player&#039;s [https://modrinth.com/mod/origins Origin].&lt;br /&gt;
==Visual Elements==&lt;br /&gt;
===[https://github.com/Manuel-3/figura-scripts/tree/main/src/confetti Confetti]===&lt;br /&gt;
&#039;&#039;&#039;Confetti&#039;&#039;&#039; is a library that allows users to add custom particles, either sprite or modelpart, to their avatars&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/readme.md Documentation]&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/example.zip Example Avatar]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===[https://discord.com/channels/1129805506354085959/1137506926742216835 KattArmor] 💬===&lt;br /&gt;
&#039;&#039;&#039;KattArmor&#039;&#039;&#039; (sometimes called Katt Armor API/Library) is a library that allows users to edit their avatar&#039;s armor, whether by adding pivots using a script or by using unique models and textures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1155212562980425818 How-To Guide]&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1262160359905562705 Example Avatars]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
= Community =&lt;br /&gt;
===[https://discord.figuramc.org FiguraMC Discord] ⭐===&lt;br /&gt;
The &#039;&#039;&#039;FiguraMC Discord Server&#039;&#039;&#039; is the central place for everything Figura, including help and support for the mod, avatar showcasing, and more. You&#039;ll also need to join this server to request whitelist to the FiguraSMP.&lt;br /&gt;
== Minecraft Servers ==&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some servers listed below are whitelisted.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Servers that have a public whitelist application process will be marked with a 🔒 icon.&lt;br /&gt;
* Servers that are invite-only will be marked with a 🛡️ icon.&lt;br /&gt;
}}&lt;br /&gt;
=== Figura Plaza ⭐ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;plaza.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version: 1.16.5 - 1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; is an official lobby-like server where players can join, hang out with other Figura users, make avatars in company, play games, and occasionally attend events. The server does not have any survival gameplay, and disables PvP by default. The server also provides a selection of free temporary items to use when testing avatars.&lt;br /&gt;
&lt;br /&gt;
=== Figura SMP ⭐🔒 ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;vanilla.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura SMP&#039;&#039;&#039; (also referred to as Vanilla SMP) is an official survial server that stays close to the base game, plus a few server-side mods for quality-of-life purposes. You are perfectly able to join this server without any mods, and even on a vanilla client. You can read the server rules in the [https://discord.figuramc.org FiguraMC Discord Server]&#039;s [https://discord.com/channels/1129805506354085959/1130186794873405510 #info] channel and get whitelisted by putting your name in [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist].&lt;br /&gt;
&lt;br /&gt;
==== Modded SMP ====&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1-fabric&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Modpack:&amp;amp;nbsp;&amp;lt;span style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Modded SMP&#039;&#039;&#039; is a seasonal modpack server adjacent to Figura SMP, each season coming with its own theme. &#039;&#039;&#039;Currently offline.&#039;&#039;&#039; The next season is themed after a nuclear apocalypse and is set for release Soon™. The ModdedSMP shares a whitelist with the VanillaSMP, meaning that [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist] will whitelist you for both servers.&lt;br /&gt;
&lt;br /&gt;
=== 4p5.nz 🛡️ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;4p5.nz&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; is an invite-only creative/operator server where players have free reign over the world around them.&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=534</id>
		<title>Community Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=534"/>
		<updated>2024-10-05T20:44:05Z</updated>

		<summary type="html">&lt;p&gt;Slyme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is heavily unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Please wait before referring other people to this page. If you&#039;re able to, please [[FiguraMC:Contributing|contribute]]!&lt;br /&gt;
}}&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some of the resources listed here are not officially endorsed by FiguraMC.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Resources affiliated with FiguraMC will be marked as such with a ⭐ icon.&lt;br /&gt;
}}&lt;br /&gt;
= Documentation =&lt;br /&gt;
===&#039;&#039;&#039;[https://applejuiceyy.github.io/figs/ Figs]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Figs&#039;&#039;&#039; is an online documentation browser for Figura, making using Figura&#039;s built-in documentation easier to use.&lt;br /&gt;
===&#039;&#039;&#039;[https://wiki.figuramc.org Figura Wiki]&#039;&#039;&#039; (YOU ARE HERE) ⭐===&lt;br /&gt;
The &#039;&#039;&#039;Figura Wiki&#039;&#039;&#039; is an online wiki that aims to document Figura, its scripting language, modeling, etc.&lt;br /&gt;
== Lua Documenation ==&lt;br /&gt;
===&#039;&#039;&#039;[https://manuel-3.github.io/lua-quickstart Lua Quickstart Guide]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Manuel&#039;s Lua Quickstart Guide&#039;&#039;&#039; is a quick, online tutorial guiding users through the basics of Lua syntax.&lt;br /&gt;
===&#039;&#039;&#039;[http://lua.org/manual/5.1 Lua 5.1 Manual]&#039;&#039;&#039;===&lt;br /&gt;
The &#039;&#039;&#039;Lua Manual&#039;&#039;&#039; is a long document describing the ins and outs of vanilla Lua. Although some of it will not apply to Figura Lua, it&#039;s still very useful for learning about the standard libraries.&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
===&#039;&#039;&#039;[https://www.youtube.com/playlist?list=PLNz7v2g2SFA8lOQUDS4z4-gIDLi_dWAhl Chloe&#039;s Video Tutorial Series]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Chloe&#039;s Tutorial Series&#039;&#039;&#039; is a video series on YouTube that acts as a way for new users to get used to the mod. The series covers everything from modeling and modifying &amp;lt;code&amp;gt;avatar.json&amp;lt;/code&amp;gt; files to scripting.&lt;br /&gt;
= Tools =&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/GrandpaScout/FiguraRewriteVSDocs GS&#039; Figura VSCode Documentation]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;GrandpaScout&#039;s Figura VSCode Documentation&#039;&#039;&#039; is an addon for Visual Studio Code (along with Code OSS and VSCodium) that adds Figura&#039;s documentation and snippets to [https://marketplace.visualstudio.com/items?itemName=sumneko.lua sumneko&#039;s Lua Language Server plugin].&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://github.com/GrandpaScout/FiguraRewriteVSDocs/wiki Install Guide]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/KitCat962/figura-format-bbplugin Katt&#039;s Figura Blockbench Extension]&#039;&#039;&#039;===&lt;br /&gt;
The &#039;&#039;&#039;Figura Blockbench Extension&#039;&#039;&#039; adds a new model format to Blockbench, the Figura Model format. It extends the base Generic Model format by adding tools to make the avatar creation process easier, lifting restrictions to the Generic Model format that Figura supports, and removing features Figura doesn&#039;t.&lt;br /&gt;
= Assets (Scripts, Libraries, APIs) =&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some assets only exist within the [https://discord.figuramc.org FiguraMC Discord].&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Assets that link to the FiguraMC Discord will be marked with a 💬 icon.&lt;br /&gt;
}}&lt;br /&gt;
== Animation Helpers ==&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/GrandpaScout/GSAnimBlend GSAnimBlend]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;GSAnimBlend&#039;&#039;&#039; is a script that automatically adds blends to the start and end of animations.&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/JimmyHelp/JimmyAnims Jimmy&#039;s Animation Handler]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;JimmyAnim&#039;&#039;&#039; (full name Jimmy&#039;s Animation Helper) is a library that plays specific Blockbench animations based on the player&#039;s current action.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://jimmyhelp.notion.site/JimmyAnims-79adfdca2fe04f9c9ede5e0bfd898b6a Documentation]&lt;br /&gt;
* [https://github.com/JimmyHelp/JimmyAnims/blob/main/JimmyExample.lua Example Usage]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== World Interactions==&lt;br /&gt;
===&#039;&#039;&#039;[https://discord.com/channels/1129805506354085959/1132467393050968214/1132467393050968214 Origins API]&#039;&#039;&#039; 💬===&lt;br /&gt;
Katt&#039;s &#039;&#039;&#039;Origins API&#039;&#039;&#039; is an API that uses the player&#039;s NBT data to get information about the player&#039;s [https://modrinth.com/mod/origins Origin].&lt;br /&gt;
==Visual Elements==&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/Manuel-3/figura-scripts/tree/main/src/confetti Confetti]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Confetti&#039;&#039;&#039; is a library that allows users to add custom particles, either sprite or modelpart, to their avatars&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/readme.md Documentation]&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/example.zip Example Avatar]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===&#039;&#039;&#039;[https://discord.com/channels/1129805506354085959/1137506926742216835 KattArmor]&#039;&#039;&#039; 💬===&lt;br /&gt;
&#039;&#039;&#039;KattArmor&#039;&#039;&#039; (sometimes called Katt Armor API/Library) is a library that allows users to edit their avatar&#039;s armor, whether by adding pivots using a script or by using unique models and textures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1155212562980425818 How-To Guide]&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1262160359905562705 Example Avatars]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
= Community =&lt;br /&gt;
===&#039;&#039;&#039;[https://discord.figuramc.org FiguraMC Discord]&#039;&#039;&#039; ⭐===&lt;br /&gt;
The &#039;&#039;&#039;FiguraMC Discord Server&#039;&#039;&#039; is the central place for everything Figura, including help and support for the mod, avatar showcasing, and more. You&#039;ll also need to join this server to request whitelist to the FiguraSMP.&lt;br /&gt;
== Minecraft Servers ==&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some servers listed below are whitelisted.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Servers that have a public whitelist application process will be marked with a 🔒 icon.&lt;br /&gt;
* Servers that are invite-only will be marked with a 🛡️ icon.&lt;br /&gt;
}}&lt;br /&gt;
=== Figura Plaza ⭐ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;plaza.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version: 1.16.5 - 1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; is an official lobby-like server where players can join, hang out with other Figura users, make avatars in company, play games, and occasionally attend events. The server does not have any survival gameplay, and disables PvP by default. The server also provides a selection of free temporary items to use when testing avatars.&lt;br /&gt;
&lt;br /&gt;
=== Figura SMP ⭐🔒 ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;vanilla.figuramc.org&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.21&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Figura SMP&#039;&#039;&#039; (also referred to as Vanilla SMP) is an official survial server that stays close to the base game, plus a few server-side mods for quality-of-life purposes. You are perfectly able to join this server without any mods, and even on a vanilla client. You can read the server rules in the [https://discord.figuramc.org FiguraMC Discord Server]&#039;s [https://discord.com/channels/1129805506354085959/1130186794873405510 #info] channel and get whitelisted by putting your name in [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist].&lt;br /&gt;
&lt;br /&gt;
==== Modded SMP ====&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1-fabric&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Modpack:&amp;amp;nbsp;&amp;lt;span style=&amp;quot;user-select: none&amp;quot;&amp;gt;[TBD]&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Modded SMP&#039;&#039;&#039; is a seasonal modpack server adjacent to Figura SMP, each season coming with its own theme. &#039;&#039;&#039;Currently offline.&#039;&#039;&#039; The next season is themed after a nuclear apocalypse and is set for release Soon™. The ModdedSMP shares a whitelist with the VanillaSMP, meaning that [https://discord.com/channels/1129805506354085959/1130187119680311470 #whitelist] will whitelist you for both servers.&lt;br /&gt;
&lt;br /&gt;
=== 4p5.nz 🛡️ ===&lt;br /&gt;
&#039;&#039;&#039;IP:&amp;amp;nbsp;&amp;lt;code style=&amp;quot;user-select: all&amp;quot;&amp;gt;4p5.nz&amp;lt;/code&amp;gt;&#039;&#039;&#039; &amp;amp;bull; &#039;&#039;&#039;Version:&amp;amp;nbsp;1.20.1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; is an invite-only creative/operator server where players have free reign over the world around them.&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=520</id>
		<title>Community Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=520"/>
		<updated>2024-10-05T19:30:47Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Adding more resources. If someone could make an inline icon template that would be amazing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is heavily unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Please wait before referring other people to this page. If you&#039;re able to, please [[FiguraMC:Contributing|contribute]]!&lt;br /&gt;
}}&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some of the resources listed here are not officially endorsed by FiguraMC.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Resources affiliated with FiguraMC will be marked as such with a ⭐ icon.&lt;br /&gt;
}}&lt;br /&gt;
= Documentation =&lt;br /&gt;
===&#039;&#039;&#039;[https://applejuiceyy.github.io/figs/ Figs]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Figs&#039;&#039;&#039; is an online documentation browser for Figura, making using Figura&#039;s built-in documentation easier to use.&lt;br /&gt;
===&#039;&#039;&#039;[https://wiki.figuramc.org Figura Wiki]&#039;&#039;&#039; (YOU ARE HERE) ⭐===&lt;br /&gt;
The &#039;&#039;&#039;Figura Wiki&#039;&#039;&#039; is an online wiki that aims to document Figura, its scripting language, modeling, etc.&lt;br /&gt;
== Lua Documenation ==&lt;br /&gt;
===&#039;&#039;&#039;[https://manuel-3.github.io/lua-quickstart Lua Quickstart Guide]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Manuel&#039;s Lua Quickstart Guide&#039;&#039;&#039; is a quick, online tutorial guiding users through the basics of Lua syntax.&lt;br /&gt;
===&#039;&#039;&#039;[http://lua.org/manual/5.1 Lua 5.1 Manual]&#039;&#039;&#039;===&lt;br /&gt;
The &#039;&#039;&#039;Lua Manual&#039;&#039;&#039; is a long document describing the ins and outs of vanilla Lua. Although some of it will not apply to Figura Lua, it&#039;s still very useful for learning about the standard libraries.&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
===&#039;&#039;&#039;[https://www.youtube.com/playlist?list=PLNz7v2g2SFA8lOQUDS4z4-gIDLi_dWAhl Chloe&#039;s Video Tutorial Series]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Chloe&#039;s Tutorial Series&#039;&#039;&#039; is a video series on YouTube that acts as a way for new users to get used to the mod. The series covers everything from modeling and modifying &amp;lt;code&amp;gt;avatar.json&amp;lt;/code&amp;gt; files to scripting.&lt;br /&gt;
= Tools =&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/GrandpaScout/FiguraRewriteVSDocs GS&#039; Figura VSCode Documentation]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;GrandpaScout&#039;s Figura VSCode Documentation&#039;&#039;&#039; is an addon for Visual Studio Code (along with Code OSS and VSCodium) that adds Figura&#039;s documentation and snippets to [https://marketplace.visualstudio.com/items?itemName=sumneko.lua sumneko&#039;s Lua Language Server plugin].&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://github.com/GrandpaScout/FiguraRewriteVSDocs/wiki Install Guide]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/KitCat962/figura-format-bbplugin Katt&#039;s Figura Blockbench Extension]&#039;&#039;&#039;===&lt;br /&gt;
The &#039;&#039;&#039;Figura Blockbench Extension&#039;&#039;&#039; adds a new model format to Blockbench, the Figura Model format. It extends the base Generic Model format by adding tools to make the avatar creation process easier, lifting restrictions to the Generic Model format that Figura supports, and removing features Figura doesn&#039;t.&lt;br /&gt;
= Assets (Scripts, Libraries, APIs) =&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some assets only exist within the [https://discord.figuramc.org FiguraMC Discord].&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Assets that link to the FiguraMC Discord will be marked with a 💬 icon.&lt;br /&gt;
}}&lt;br /&gt;
== Animation Helpers ==&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/GrandpaScout/GSAnimBlend GSAnimBlend]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;GSAnimBlend&#039;&#039;&#039; is a script that automatically adds blends to the start and end of animations.&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/JimmyHelp/JimmyAnims Jimmy&#039;s Animation Handler]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;JimmyAnim&#039;&#039;&#039; (full name Jimmy&#039;s Animation Helper) is a library that plays specific Blockbench animations based on the player&#039;s current action.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://jimmyhelp.notion.site/JimmyAnims-79adfdca2fe04f9c9ede5e0bfd898b6a Documentation]&lt;br /&gt;
* [https://github.com/JimmyHelp/JimmyAnims/blob/main/JimmyExample.lua Example Usage]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== World Interactions==&lt;br /&gt;
===&#039;&#039;&#039;[https://discord.com/channels/1129805506354085959/1132467393050968214/1132467393050968214 Origins API]&#039;&#039;&#039; 💬===&lt;br /&gt;
Katt&#039;s &#039;&#039;&#039;Origins API&#039;&#039;&#039; is an API that uses the player&#039;s NBT data to get information about the player&#039;s [https://modrinth.com/mod/origins Origin].&lt;br /&gt;
==Visual Elements==&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/Manuel-3/figura-scripts/tree/main/src/confetti Confetti]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Confetti&#039;&#039;&#039; is a library that allows users to add custom particles, either sprite or modelpart, to their avatars&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/readme.md Documentation]&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/example.zip Example Avatar]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===&#039;&#039;&#039;[https://discord.com/channels/1129805506354085959/1137506926742216835 KattArmor]&#039;&#039;&#039; 💬===&lt;br /&gt;
&#039;&#039;&#039;KattArmor&#039;&#039;&#039; (sometimes called Katt Armor API/Library) is a library that allows users to edit their avatar&#039;s armor, whether by adding pivots using a script or by using unique models and textures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1155212562980425818 How-To Guide]&lt;br /&gt;
* [https://discord.com/channels/1129805506354085959/1137506926742216835/1262160359905562705 Example Avatars]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
= Community =&lt;br /&gt;
===&#039;&#039;&#039;[https://discord.figuramc.org FiguraMC Discord]&#039;&#039;&#039; ⭐===&lt;br /&gt;
The &#039;&#039;&#039;FiguraMC Discord Server&#039;&#039;&#039; is the central place for everything Figura, including help and support for the mod, avatar showcasing, and more. You&#039;ll also need to join this server to request whitelist to the FiguraSMP.&lt;br /&gt;
== Minecraft Servers ==&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some servers listed below are whitelisted.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Servers that have a public whitelist application process will be marked with a 🔒 icon.&lt;br /&gt;
* Servers that are invite-only will be marked with a 🛡️ icon.&lt;br /&gt;
}}&lt;br /&gt;
===&#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; ⭐===&lt;br /&gt;
&#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; is a lobby-like server where players can join, hang out with other Figura users, make avatars in company, play games, and occasionally attend events.&lt;br /&gt;
 plaza.figuramc.org&lt;br /&gt;
===&#039;&#039;&#039;FiguraSMP&#039;&#039;&#039; ⭐🔒===&lt;br /&gt;
The &#039;&#039;&#039;FiguraSMP&#039;&#039;&#039; is a set of two survival multiplayer servers—Vanilla and Modded—that are ran in affiliation with FiguraMC.&lt;br /&gt;
*Vanilla FiguraSMP is a server that stays close to the base game, only adding quality of life features for public servers.&lt;br /&gt;
*ModdedSMP is a seasonal modpack server, each season coming with its own theme.&lt;br /&gt;
&lt;br /&gt;
Below is the Vanilla FiguraSMP address since the Modded SMP is currently between seasons.&lt;br /&gt;
 vanilla.figuramc.org&lt;br /&gt;
===&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; 🛡️===&lt;br /&gt;
&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; is an invite-only creative/operator server where players have free reign over the world around them.&lt;br /&gt;
 4p5.nz&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=512</id>
		<title>Community Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Community_Resources&amp;diff=512"/>
		<updated>2024-10-05T05:33:19Z</updated>

		<summary type="html">&lt;p&gt;Slyme: First Draft; please continue adding on!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice/Warning&lt;br /&gt;
 |content=&#039;&#039;&#039;This page is heavily unfinished.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Please wait before referring other people to this page. If you&#039;re able to, please [[FiguraMC:Contributing|contribute]]!&lt;br /&gt;
}}&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some of the resources listed here are not officially endorsed by FiguraMC.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Resources affiliated with FiguraMC will be marked as such with a ⭐ icon.&lt;br /&gt;
}}&lt;br /&gt;
= Documentation =&lt;br /&gt;
===&#039;&#039;&#039;[https://applejuiceyy.github.io/figs/ Figs]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Figs&#039;&#039;&#039; is an online documentation browser for Figura, making using Figura&#039;s built-in documentation easier to use.&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
===&#039;&#039;&#039;[https://www.youtube.com/playlist?list=PLNz7v2g2SFA8lOQUDS4z4-gIDLi_dWAhl Chloe&#039;s Video Tutorial Series]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Chloe&#039;s Tutorial Series&#039;&#039;&#039; is a video series on YouTube that acts as a way for new users to get used to the mod. The series covers everything from modeling and modifying &amp;lt;code&amp;gt;avatar.json&amp;lt;/code&amp;gt; files to scripting.&lt;br /&gt;
= Assets (Scripts, Libraries, APIs) =&lt;br /&gt;
==World Elements==&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/GrandpaScout/GSAnimBlend GSAnimBlend]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;GSAnimBlend&#039;&#039;&#039; is a script that automatically adds blends to the start and end of animations.&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/JimmyHelp/JimmyAnims Jimmy&#039;s Animation Handler]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;JimmyAnim&#039;&#039;&#039; (full name Jimmy&#039;s Animation Helper) is a library that plays specific Blockbench animations based on the player&#039;s current action.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://github.com/JimmyHelp/JimmyAnims/blob/main/JimmyExample.lua Example Usage]&lt;br /&gt;
* [https://jimmyhelp.notion.site/JimmyAnims-79adfdca2fe04f9c9ede5e0bfd898b6a Documentation]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===&#039;&#039;&#039;[https://github.com/Manuel-3/figura-scripts/tree/main/src/confetti Confetti]&#039;&#039;&#039;===&lt;br /&gt;
&#039;&#039;&#039;Confetti&#039;&#039;&#039; is a library that allows users to add custom particles, either sprite or modelpart, to their avatars&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;&lt;br /&gt;
Additional Resources&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-toggle-placeholder&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/example.zip Example Avatar]&lt;br /&gt;
* [https://github.com/Manuel-3/figura-scripts/blob/main/src/confetti/readme.md Documentation]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
= Community =&lt;br /&gt;
===&#039;&#039;&#039;[https://discord.figuramc.org FiguraMC Discord]&#039;&#039;&#039; ⭐===&lt;br /&gt;
The &#039;&#039;&#039;FiguraMC Discord Server&#039;&#039;&#039; is the central place for everything Figura, including help and support for the mod, avatar showcasing, and more. You&#039;ll also need to join this server to request whitelist to the FiguraSMP.&lt;br /&gt;
== Minecraft Servers ==&lt;br /&gt;
{{Notice&lt;br /&gt;
 |content=&#039;&#039;&#039;Some servers listed below are whitelisted.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Servers that have a public whitelist application process will be marked with a 🔒 icon.&lt;br /&gt;
* Servers that are invite-only will be marked with a 🛡️ icon.&lt;br /&gt;
}}&lt;br /&gt;
===&#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; ⭐===&lt;br /&gt;
&#039;&#039;&#039;Figura Plaza&#039;&#039;&#039; is a lobby-like server where players can join, hang out with other Figura users, make avatars in company, play games, and occasionally attend events.&lt;br /&gt;
 plaza.figuramc.org&lt;br /&gt;
===&#039;&#039;&#039;FiguraSMP&#039;&#039;&#039; ⭐🔒===&lt;br /&gt;
The &#039;&#039;&#039;FiguraSMP&#039;&#039;&#039; is a set of two survival multiplayer servers—Vanilla and Modded—that are ran in affiliation with FiguraMC.&lt;br /&gt;
*Vanilla FiguraSMP is a server that stays close to the base game, only adding quality of life features for public servers.&lt;br /&gt;
*ModdedSMP is a seasonal modpack server, each season coming with its own theme.&lt;br /&gt;
&lt;br /&gt;
Below is the Vanilla FiguraSMP address since the Modded SMP is currently between seasons&lt;br /&gt;
 vanilla.figuramc.org&lt;br /&gt;
===&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; 🛡️===&lt;br /&gt;
&#039;&#039;&#039;4p5.nz&#039;&#039;&#039; is an invite-only creative/operator server where players have free reign over the world around them.&lt;br /&gt;
 4p5.nz&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=User:Slyme&amp;diff=382</id>
		<title>User:Slyme</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=User:Slyme&amp;diff=382"/>
		<updated>2024-09-28T22:47:49Z</updated>

		<summary type="html">&lt;p&gt;Slyme: Created page with &amp;quot;== Hi, players! == It&amp;#039;s me!&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-size:8pt;color:#00000050&amp;quot;&amp;gt;Profile Art by Deni&amp;lt;/span&amp;gt; I&amp;#039;m Slyme, a person on the internet. I do quite a lot of stuff with Figura — making avatars, scripts, official emojis, and more! &amp;lt;hr style=&amp;quot;width:50%;height:2px;background: linear-gradient(90deg, rgba(226,140,0,1) 0%, rgba(236,205,0,1) 25%, rgba(255,255,255,1) 50%, rgba(98,174,220,1) 75%,...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hi, players! ==&lt;br /&gt;
[[File:Slyme-Avatar.png|thumb|alt=A portrait of Slyme, a green humanoid slime.|It&#039;s me!&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;font-size:8pt;color:#00000050&amp;quot;&amp;gt;Profile Art by Deni&amp;lt;/span&amp;gt;]]&lt;br /&gt;
I&#039;m Slyme, a person on the internet. I do quite a lot of stuff with Figura — making avatars, scripts, official emojis, and more!&lt;br /&gt;
&amp;lt;hr style=&amp;quot;width:50%;height:2px;background: linear-gradient(90deg, rgba(226,140,0,1) 0%, rgba(236,205,0,1) 25%, rgba(255,255,255,1) 50%, rgba(98,174,220,1) 75%, rgba(32,56,86,1) 100%);border-bottom: solid 1px #0003;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Species&#039;&#039;&#039;&lt;br /&gt;
| Slime&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Tz_database &#039;&#039;&#039;Time Zone&#039;&#039;&#039;]&lt;br /&gt;
| America/Chicago&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Site&#039;&#039;&#039;&lt;br /&gt;
| https://slyme.xyz&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=File:Slyme-Avatar.png&amp;diff=381</id>
		<title>File:Slyme-Avatar.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=File:Slyme-Avatar.png&amp;diff=381"/>
		<updated>2024-09-28T22:25:59Z</updated>

		<summary type="html">&lt;p&gt;Slyme: A portrait of Slyme, a green humanoid slime.
Art by Deni&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
A portrait of Slyme, a green humanoid slime.&lt;br /&gt;
Art by Deni&lt;/div&gt;</summary>
		<author><name>Slyme</name></author>
	</entry>
</feed>