How To Check If a String is in a table

Hello! I need help with this script. Ive been trying to change the color of the gui text based off of the table they are in. I want to be able to just put them in the table then it checks if its in common or uncommon etc, then sets the right color for that table, common being white, uncommon being green etc. Basically if lets say “OFA” was in uncommon it would be green but if it was in PlusUltra it will be Golden, its like a auto switch depending on the table it is in, and i want to be able to add multiple strings per each table, like “Regeneration” and “OFA” if they were both in common if i had either one of them my text would be white.


local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild(“Humanoid”)

local Common = {


local Uncommon = {


local Rare = {


local PlusUltra = {

while wait(5) do
local Quirk = script.Parent:WaitForChild(“QuirkName”)
Quirk.Text = game.StarterGui.Values.Abillity.Value
if game.StarterGui.Values.Abillity.Value == Common then
Quirk.TextColor3 = Color3.fromRGB(212,200,255)
elseif game.StarterGui.Values.Abillity.Value == Uncommon then
Quirk.TextColor3 = Color3.fromRGB(50,205,50)
elseif game.StarterGui.Values.Abillity.Value == Rare then
Quirk.TextColor3 = Color3.fromRGB(50,50,205)
elseif game.StarterGui.Values.Abillity.Value == PlusUltra then
Quirk.TextColor3 = Color3.fromRGB(212,175,55)

1 Like

Sounds like you need to do some string manipulation

1 Like
if table.find(Table, String) then

I havent tried this yet but it seems like i would have to go through and do that for every single common, uncommon etc. I’ll try tho

actually can u put multiple strings? like if table.find(Table,String,String,String) …?

Hmm nevermind i’ll set them serperately until i learn how to use string manipilation

Oh yea thank you for this, i didnt know u can do that

ur amazing lollllllllllllllllllllllllllllllllllllllllll