I am trying to make it to where you press 1 twice, it states 11 on the display instead of just the 1, as in doing a test for stacking other numbers into a code for like 2521 for example, any ideas?
Good Luck with your game!
Add: KeyPad script change
(handles over entrees)
snippet
for i = 0, 9 do
buttons:WaitForChild(i).ClickDetector.MouseClick:Connect(function()
press:Play() input = input .. tostring(i)
if string.len(input) < 5 then
inputLabel.Text = input
else ClearCode()
end
end)
end
function ClearCode()
input = "" inputLabel.Text = "****"
end
function EnterCode()
if input == correctCode then enter:Play()
inputLabel.Text = " Access "
-- they got it, do whatever
task.wait(1)
else inputLabel.Text = "****"
end task.wait(1)
ClearCode()
end
enterButton.ClickDetector.MouseClick:Connect(EnterCode)
clearButton.ClickDetector.MouseClick:Connect(ClearCode)
local p = script.Parent
local screen = p.Display.SurfaceGui.KeyText
local combination = p.Combination
local numbers = p.Numbers
local keypad = {p.N0, p.N1, p.N2, p.N3, p.N4, p.N5, p.N6, p.N7, p.N8, p.N9}
numbers.Changed:Connect(function(val)
screen.Text = val
end)
for _, v in keypad do
v.ClickDetector.MouseClick:Connect(function()
if screen.Text:len() == 4 then return end
numbers.Value = numbers.Value..string.split(v.Name, "N")
end)
end