Actulurus πŸ‘‘ Profile picture
Aug 18 β€’ 8 tweets β€’ 3 min read
πŸ“Œ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. ❌
To create a while loop, simply write "while X do", replacing X by a condition. After that comes your code and don't forget to close it with an "end". πŸ€”

Like this πŸ‘‡ Image
❗IMPORTANT πŸ‘‡

All these loops are just examples. In reality, the code would crash if you tried to use these. ❌

πŸ‘‡
Why is that? πŸ€”

It's because the loop would try to run infinitely each frame. We always need to include some sort of delay, so the loop pauses and "cools down" ❄️
So, while loops are very easy to learn if you already know about if-statements. πŸŽ‰

If you didn't understand something, click on my profile and read the previous threads. πŸ€”
If you'd like to learn more, follow @notactulurus to stay updated about tomorrow's thread - which is about the FOR-LOOP ✨

If we surpass @AntcarTweets in follower count, my last follower will get 1k R$! πŸ’Έ

β€’ β€’ β€’

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 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
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!

:(