of     1   

SparkleOff
#141289790Wednesday, July 23, 2014 5:44 PM GMT

I was wondering if there is an easier way to do this script instead making a bunch of if statements. I have a bingo game and i am trying to make it where they call bingo, instead of making a bunch of if's for each button (number) which there is like 25 buttons. Is there an easier way if it checks if they got a bingo?
SparkleOff
#141289890Wednesday, July 23, 2014 5:45 PM GMT

(I didn't make the script yes because if there is no easier way then i am going to have to make a bunch of if statements.
super10099
#141289981Wednesday, July 23, 2014 5:46 PM GMT

pcalls
SparkleOff
#141290165Wednesday, July 23, 2014 5:48 PM GMT

Like what i mean is like: Make a if statement for each button in the row like: if script.Parent.Parent.TextButton.ImageLabel.Visible == true then    if script.Parent.Parent.Textbutton1.ImageLabel.Visible == true then         print("And so on")    end end
super10099
#141290283Wednesday, July 23, 2014 5:49 PM GMT

>Solution :Don't be lazy.
BothAngles
#141290294Wednesday, July 23, 2014 5:49 PM GMT

thats easy XD
SparkleOff
#141290316Wednesday, July 23, 2014 5:49 PM GMT

@super I don't get pcall. Just read it on the wiki.
SparkleOff
#141290431Wednesday, July 23, 2014 5:51 PM GMT

@super There is 25 buttons i just want to know if there is an easier way. In the script i am going to make the might be like 50+ if statements.
SparkleOff
#141290575Wednesday, July 23, 2014 5:52 PM GMT

Here is the locals i have local i1 = script.Parent.Parent.ImageLabel.i1 local i2 = script.Parent.Parent.ImageLabel.i2 local i3 = script.Parent.Parent.ImageLabel.i3 local i4 = script.Parent.Parent.ImageLabel.i4 local i5 = script.Parent.Parent.ImageLabel.i5 local b1 = script.Parent.Parent.ImageLabel.b1 local b2 = script.Parent.Parent.ImageLabel.b2 local b3 = script.Parent.Parent.ImageLabel.b3 local b4 = script.Parent.Parent.ImageLabel.b4 local b5 = script.Parent.Parent.ImageLabel.b5 local n1 = script.Parent.Parent.ImageLabel.n1 local n2 = script.Parent.Parent.ImageLabel.n2 local n3 = script.Parent.Parent.ImageLabel.n3 local n4 = script.Parent.Parent.ImageLabel.n4 local n5 = script.Parent.Parent.ImageLabel.n5 local g1 = script.Parent.Parent.ImageLabel.g1 local g2 = script.Parent.Parent.ImageLabel.g2 local g3 = script.Parent.Parent.ImageLabel.g3 local g4 = script.Parent.Parent.ImageLabel.g4 local g5 = script.Parent.Parent.ImageLabel.g5 local o1 = script.Parent.Parent.ImageLabel.o1 local o2 = script.Parent.Parent.ImageLabel.o2 local o3 = script.Parent.Parent.ImageLabel.o3 local o4 = script.Parent.Parent.ImageLabel.o4 local o5 = script.Parent.Parent.ImageLabel.o5
Kodran
#141290633Wednesday, July 23, 2014 5:53 PM GMT

topRow = {} 2ndtopRow = {} 3rdtopRow = {} 4thtopRow = {} bottomRow = {} for i, v in pairs (array of the spaces on bingo card) do if v is on top row then topRow[#topRow + 1] = true end if v is on 2nd top row then 2ndtopRow[#2ndtopRow + 1] = true end if v is on 3rd top row then 3rdtopRow[#3rdtopRow + 1] = true end if v is on 4th top row then 4thtopRow[#4thtopRow + 1] = true end if v is on bottom row then bottomRow[#bottomRow + 1] = true end end if #topRow >= 5 then --bingo on top row end if #2ndtopRow >= 5 then --bingo on 2nd top row end if #3rdtopRow >= 5 then --bingo on 3rd top row end if #4thtopRow >= 5 then --bingo on 4th top row end if #bottomRow >= 5 then --bingo on bottom row end then you could do this also for columns
BothAngles
#141290743Wednesday, July 23, 2014 5:54 PM GMT

O_O e_o holy crap dude i saw that and started crying
128GB
#141290992Wednesday, July 23, 2014 5:57 PM GMT

How about having them select the spaces that give them a bingo, then only check the 5 selected if they are in a row
SparkleOff
#141291016Wednesday, July 23, 2014 5:57 PM GMT

What would be the array? (sorry don't know about that)
SparkleOff
#141291299Wednesday, July 23, 2014 6:00 PM GMT

And what do you mean by is on? what is it supposed to be changed to.
SparkleOff
#141291487Wednesday, July 23, 2014 6:02 PM GMT

nvm i got the array.

    of     1