I am trying to make a randomizer that draws a number and then a button that removes a value in an array.
This is the code that is triggered by pressing the brick that picks a random number from the table.
values = {"2", "7", "0", "5", "3", "X", "X", "X"}
function draw()
script.Parent.Value.Value = values[math.random(#values)]
script.Parent.Chip.SurfaceGui.TextLabel.Text = script.Parent.Value.Value
end
script.Parent.Button.ClickDetector.MouseClick:Connect(draw)
And this is the other code that is supposed to remove the specific value. It is fired by a different brick.
function show2()
table.remove(values, 1)
game.Workspace.Digits.Two.Transparency=0.8
wait(0.05)
game.Workspace.Digits.Two.Transparency=0.6
wait(0.05)
game.Workspace.Digits.Two.Transparency=0.4
wait(0.05)
game.Workspace.Digits.Two.Transparency=0.2
wait(0.05)
game.Workspace.Digits.Two.Transparency=0
wait(0.05)
end
script.Parent.firstnumber.ClickDetector.MouseClick:Connect(show2)
The 2 will be removed and 7 will take its place. But I have another block of code that is supposed to remove 7 when I press another button.
Is this possible to do?

1 comment
Thank you!