![]() _ has some functionality in loops and function parameters. You should see every index and its value!įor _, value in ipairs(tbl) do - If you change the _ to any variable name the value of that variable will be the numeric index. ![]() I prefer to use commas sometimes because it types faster and is sometimes easier to read. Print(index, "=", value) - Using commas in print, warn, or error will add a space between each item. ![]() This condition is always true: tbl = value. You can also write \n and it will be a new line in your string, just like if you press enter.įor index, value in pairs(tbl) do - This loop will loop through table giving you each index and the corresponding value. Using \ before each new line will make sure it stays there, similar to a long string using ]. Tables, Instances, Vector3s, and all others are complex) are always unique even if their content is the same." - This string also spans multiple lines. ] = "I have a non-string index too! (Notice how I didn't overwrite the previous index) \Īll complex data types (non-strings, non-numbers, non-booleans, non-nil, etc. Tables work as an array or a dictionary, and can even work as both at once. Dictionaries are sometimes referred to as objects, like in JavaScript. You may have heard of arrays which are lists, or dictionaries which “map” a specific thing to another. They can also be surrounded with ] to make them span across multiple lines, which is usually called a “multi-line” string. Strings hold text! They are surrounded by double quotes, ", or single quotes, '. ![]() If you’re brand new you should read The Basics below, but if you know about variables, functions, and data types you should skip to Concepts, where I explain some of the Roblox-specific ideas that’ll allow you to read the information on the devhub ( ) The Basics Data types Strings This is definitely missing a lot of important information, but I will be updating it more in the future! ![]() I’ve written this guide/tutorial to help people who are new to scripting on Roblox learn some basic concepts of scripting, and hopefully understand it better. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |