I was trying to make simple bingo game and this is script for random numbers that being given to players.
So the problem is that its not making all of that numbers you can see below “True” and just stops giving numbers at some point and i cant figure out why.
Can someone help me with that pls?
local Player = game:GetService('Players')
local repSt = game:GetService('ReplicatedStorage')
local INTERMISSION_TIME = 5
local NUMBER_INTERVAL_TIME = 0.1
local NUMBERS_COUNT = 45
Player.PlayerAdded:Connect(function(plr)
for i = INTERMISSION_TIME, 0, -1 do
wait(1)
print('game starting in '..i..' seconds')
end
wait(1)
local nums = {
[0] = false,
[1] = false,
[2] = false,
[3] = false,
[4] = false,
[5] = false,
[6] = false,
[7] = false,
[8] = false,
[9] = false,
[10] = false,
[11] = false,
[12] = false,
[13] = false,
[14] = false,
[15] = false,
[16] = false,
[17] = false,
[18] = false,
[19] = false,
[20] = false,
[21] = false,
[22] = false,
[23] = false,
[24] = false,
[25] = false,
[26] = false,
[27] = false,
[28] = false,
[29] = false,
[30] = false,
[31] = false,
[32] = false,
[33] = false,
[34] = false,
[35] = false,
[36] = false,
[37] = false,
[38] = false,
[39] = false,
[40] = false,
[41] = false,
[42] = false,
[43] = false,
[44] = false,
[45] = false,
[46] = false,
[47] = false,
[48] = false,
[49] = false,
[50] = false,
[51] = false,
[52] = false,
[53] = false,
[54] = false,
[55] = false,
[56] = false,
[57] = false,
[58] = false,
[59] = false,
[60] = false,
[61] = false,
[62] = false,
[63] = false,
[64] = false,
[65] = false,
[66] = false,
[67] = false,
[68] = false,
[69] = false,
[70] = false,
[71] = false,
[72] = false,
[73] = false,
[74] = false,
[75] = false,
}
for i,v in pairs(nums) do
local ranNum = math.random(0,75)
repSt:WaitForChild('Num'):FireAllClients(plr, ranNum)
if nums[ranNum] == false then
nums[ranNum] = true
print(ranNum)
wait(NUMBER_INTERVAL_TIME)
local bn = plr:WaitForChild('BingoNums')
local nc = plr:WaitForChild('NumbersClaimed')
local gui = plr:WaitForChild('PlayerGui'):WaitForChild('BingoGui'):WaitForChild('Frame'):WaitForChild('MainFrame')
for i,v in pairs(bn:GetChildren()) do
if v.Value == ranNum then
nc:FindFirstChild(v.Name).Value = true
end
end
if nc.num1 == true and nc.num2 == true and nc.num3 == true and nc.num4 == true and nc.num5 == true then
print('bingo')
end
else
print('number already used')
end
end
for i,v in pairs(nums) do
if v == true then
print('e')
end
end
end)