📌 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 ➖
As covered above, a variable's value can be of any type - a string or number, a table or function and even an Instance like a part or a button! 👍

Here are all all the common types 👇
Number, 🔢
String - a sequence of letters 🔤
Table - a list of indexes and values 1️⃣🅰️
Function, 📞
Boolean - true or false ✅❌
Instance - any in-game object 🌲
Nil ⚪
What are local variables? 🔴

Local variables are used to not fill up the Global Namespace with unnecessary garbage 🗑️

But to understand that, we first need to know what Global Namespace means 👇
You cannot have two variables with the same name. If you try to declare a variable that already exists, it'll simply overwrite the previous one. ❌

But what about functions and loops?

👇
When you declare a LOCAL variable inside a function/loop, that variable is not accessible outside of the function, only inside it. 🤔
I am going to make a thread about scope/namespace in the future, but for now, this is the end.

Tomorrow's thread is going to be about TABLES, so if you want to learn more, follow @notactulurus! 🌟

👇❗
Also, we're trying to surpass @AntcarTweets in followers by the end of this month. He's offered to give me 300 R$ if we do, so all that Robux is going to my LAST FOLLOWER! 💵
@supertom145 @AstralDefined RT pls i need followers

• • •

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 18
📌 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
Read 14 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!

:(