📌 Daily #Roblox scripting thread 4!

#️⃣ TABLE INDEXING AND MORE 🔢

👇 A #RobloxDev thread!
We've already talked about the difference between arrays and dictionaries and about what an index and value is. 🤔

Today, I'll be covering the more advanced stuff like inserting new values into a table and more! 👇
How do I GET a value from a table? 🤔

This is what INDEXING means. You use the "key" that you put into the table to get its value. 🔑

Here's how it works for arrays 👇 Image
It is the same for dictionaries, just a string or boolean instead of the number (and other types) ✅

Like this 👇 Image
SETTING a value in a table is the same as with variables 👍

A little bit difficult to explain with words, but here it is in code 👇 Image
But how do we completely remove something from a table? ❌

Well, we can just SET it to NIL ⚪ Image
So now that you know the basic things, let's get onto our next topic - the Table library 📚

I am going to explain everything in simple terms for now and we'll revisit it in a future thread 👍

👇
In case you don't know what a library is, it's basically a LIST or a TABLE of a bunch of functions that have something in common - for example a Math library would be used for numbers 🔢

👇
Well this "table" library is used for - you guessed it! - tables! 👏

And here are the most common and useful functions 👇
✅ table.insert - This function is used to INSERT a new value to a position in an ARRAY. It would be hard to rearrange the indexes manually, so this function does it for you.
❌ table.remove - Removes an index from the table.
🔎 table.find - Finds a value in the table and returns its position

Some of these functions only work for arrays 🤔
That's it for tables today 🎉

Tomorrow's thread is going to be about WHILE LOOPS, so if you want to learn that, follow @notactulurus

👇❗
If we surpass @AntcarTweets in followers by the end of this month, my last follower gets 1k ROBUX 💸

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Actulurus 👑

Actulurus 👑 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @notactulurus

Aug 20
📌 Daily #Roblox scripting thread 6! ✨

🔁 FOR-LOOPS #️⃣

👇 A #RobloxDev thread!
🔁 The for-loop is used to ITERATE a certain number of times.

🤔 But what does "iterating" mean?

♻️ It means for the loop to "run" or "refresh"
2️⃣ There are two use cases for the for-loop

🔁 The first one is to loop, or iterate, a set number of times.

👇 This is how:
Read 14 tweets
Aug 18
📌Daily #Roblox scripting thread 5!

✅ WHILE LOOPS 🔁

A #RobloxDev thread 👇
While loops, or "while-true-do" loops, are one of the simplest loops in Lua. ✨

They're like if-statements, but they check the condition infinitely until stopped. 🔁

Here's an example 👇 Image
If the condition is true, the code inside the loop will run. 👍

If it's false, the loop will check again the next frame! 🔁

This means that any code AFTER the loop will NEVER run, unless the loop is stopped. ❌
Read 8 tweets
Aug 16
📌 Daily #Roblox scripting thread 2!

🗄️ VARIABLES 🗂️

👇 A #RobloxDev thread! Image
Variables - their purpose is to store data inside a script. 🗃️

They consist of a name and a value. 🤔

Their name is used to ACCESS the variable (read or write) and their value can be a number, string, boolean or even a table. I'll go over all the types later 👇
The name of a variable can contain any alphanumerical characters, but must NOT START with a number! 🔢

It can also include an underscore ➖
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(