Hello!!
I have gotten myself into a tricky spot while creating a bingo system…
Ive made everything without any major issues but this part of the script
For easier understanding, I will quickly go over how this system works…
Basically, when the player has a number on their bingo card that has been picked by a RNG, it fires a BindableEvent to this script which then checks if the number is a bingo number, which has a redish colour to it, if it does then it will put that number into the table BingoNum
.
After that it checks if BingoNum
match ones of the tables inside of BingoType
…
This is where im having issues as Im not sure on how to go about making that part
the script
--// Services
local RS = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
--// Variables
local BC = game.ServerStorage.ServerEvents.BingoCheck
local BingoTypes = {
Bingo1 = {"1", "2", "3", "4", "5"},
Bingo2 = {"6", "7", "8", "9", "10"},
Bingo3 = {"11", "12", "13/FREE", "14", "15"},
Bingo4 = {"16", "17", "18", "19", "20"},
Bingo5 = {"21", "22", "23", "24", "25"},
Bingo6 = {"1", "6", "11", "16", "21"},
Bingo7 = {"2", "7", "12", "17", "22"},
Bingo8 = {"3", "8", "13/FREE", "18", "23"},
Bingo9 = {"4", "9", "14", "19", "24"},
Bingo10 = {"5", "10", "15", "20", "25"},
}
--// Script
BC.Event:Connect(function(Player, NumList)
local textLabelContainer = {} --stores all the numbers the player has
local BingoNum = {} --stores the numbers that have been picked that the player has
for i,v in pairs(NumList:GetChildren()) do --gets the numbers the player has
if v.Name == "UIGridLayout" then continue else
table.insert(textLabelContainer, v)
end
end
for i = 1, 25 do --gets the numbers the player has that has been called out
if textLabelContainer[i].TextColor3 == Color3.fromRGB(249, 88, 88) then
table.insert(BingoNum, textLabelContainer[i])
end
end
-- this is where im having issues making
for key, bingo in BingoTypes do
for i, v in BingoNum do
if BingoNum[v] == bingo then
print("hello") -- trying to see if BingoNum has strings that Bingo1,2,3,etc also has
end
end
end
end)
Any and all help is appreciated