Variable "Tables"

How do i make a table?, for example, blocked words, but instead of doing one by one, How do i make a variable that already specified all blocked words? :

local blockedwords ={
“egg”,
“orange”,
}

1 Like

What are you asking? What are you trying to do? This post is super vague and I have no idea what you’re trying to say.

2 Likes

Roblox has already made something that blocks all bad words for you as well as a guide. Also, if you’re making a chat system you must use this or else your game will get shut down.

Yes, you can have a table store multiple values. What are you asking though? What are you confused by?

2 Likes

This, a table that can store several values. how I do?

You showed how to do it in your original post. You can just do

local blockTable = {"value1", "value2", "etc"}

You can access the values by doing blockTable[1], (which would be “value1”) blockTable[2], (“value2”) and so on. If you want to check if any of them are part of a message, you can loop through a table using a generic for loop.

4 Likes

At the time I wrote this post I didn’t know how to program properly, and I wanted to create a system to prevent bots, which I later created another topic that gave me what I wanted.

For those who are in doubt about how tables work, how to create them and more, on devhub there is a post containing all the information about tables.