I’ve been trying to make a keypad which opens a door briefly, but only for the person who typed the code. Ive got it working in a normal script, and I know ill most likely have to use remote events, but can anyone help me?
Code = “2087” --change To any numbers You like
Input = “”
local keypad = game.Workspace.CEDoor.KeyPad
–This Is for my friends
–created by Djmankiewics
–Clear And Enter
function Clear()
print(“Cleared”)
Input = “”
end
keypad.Clear.ClickDetector.MouseClick:connect(Clear)
function Enter()
if Input == Code then
print(“Entered”)
Input = “”
local door = game.Workspace.CEDoor.Door
door.CanCollide = false
door.Transparency = door.Transparency + 0.1
wait(0.1)
door.Transparency = door.Transparency + 0.1
wait(0.1)
door.Transparency = door.Transparency + 0.1
wait(0.1)
door.Transparency = door.Transparency + 0.1
wait(0.1)
door.Transparency = door.Transparency + 0.1
wait(0.1)
door.Transparency = door.Transparency + 0.1
wait(0.1)
door.Transparency = door.Transparency + 0.1
wait(0.1)
door.Transparency = 0.8
wait(3)--
door.Transparency = door.Transparency - 0.1
wait(0.1)
door.Transparency = door.Transparency - 0.1
wait(0.1)
door.Transparency = door.Transparency - 0.1
wait(0.1)
door.Transparency = door.Transparency - 0.1
wait(0.1)
door.Transparency = door.Transparency - 0.1
wait(0.1)
door.Transparency = door.Transparency - 0.1
wait(0.1)
door.Transparency = door.Transparency - 0.1
wait(0.1)
door.Transparency = 0
door.CanCollide = true
return end
Input = ""
print("Wrong Code")
end
keypad.Enter.ClickDetector.MouseClick:connect(Enter)
–Digets
function Click0()
Input = Input…0
print(“0”)
keypad.B0.Decal.Texture = “http://www.roblox.com/asset/?id=2767674”
wait(0.1)
keypad.B0.Decal.Texture = “http://www.roblox.com/asset/?id=2761903”
end
keypad.B0.ClickDetector.MouseClick:connect(Click0)
function Click1()
Input = Input…1
print(“1”)
keypad.B1.Decal.Texture = “http://www.roblox.com/asset/?id=2767677”
wait(0.1)
keypad.B1.Decal.Texture = “http://www.roblox.com/asset/?id=2761913”
end
keypad.B1.ClickDetector.MouseClick:connect(Click1)
function Click2()
Input = Input…2
print(“2”)
keypad.B2.Decal.Texture = “http://www.roblox.com/asset/?id=2767680”
wait(0.1)
keypad.B2.Decal.Texture = “http://www.roblox.com/asset/?id=2761922”
end
keypad.B2.ClickDetector.MouseClick:connect(Click2)
function Click3()
Input = Input…3
print(“3”)
keypad.B3.Decal.Texture = “http://www.roblox.com/asset/?id=2767686”
wait(0.1)
keypad.B3.Decal.Texture = “http://www.roblox.com/asset/?id=2761927”
end
keypad.B3.ClickDetector.MouseClick:connect(Click3)
function Click4()
Input = Input…4
print(“4”)
keypad.B4.Decal.Texture = “http://www.roblox.com/asset/?id=2767693”
wait(0.1)
keypad.B4.Decal.Texture = “http://www.roblox.com/asset/?id=2761938”
end
keypad.B4.ClickDetector.MouseClick:connect(Click4)
function Click5()
Input = Input…5
print(“5”)
keypad.B5.Decal.Texture = “http://www.roblox.com/asset/?id=2767695”
wait(0.1)
keypad.B5.Decal.Texture = “http://www.roblox.com/asset/?id=2761943”
end
keypad.B5.ClickDetector.MouseClick:connect(Click5)
function Click6()
Input = Input…6
print(“6”)
keypad.B6.Decal.Texture = “http://www.roblox.com/asset/?id=2767699”
wait(0.1)
keypad.B6.Decal.Texture = “http://www.roblox.com/asset/?id=2761948”
end
keypad.B6.ClickDetector.MouseClick:connect(Click6)
function Click7()
Input = Input…7
print(“7”)
keypad.B7.Decal.Texture = “http://www.roblox.com/asset/?id=2767701”
wait(0.1)
keypad.B7.Decal.Texture = “http://www.roblox.com/asset/?id=2761956”
end
keypad.B7.ClickDetector.MouseClick:connect(Click7)
function Click8()
Input = Input…8
print(“8”)
keypad.B8.Decal.Texture = “http://www.roblox.com/asset/?id=2767707”
wait(0.1)
keypad.B8.Decal.Texture = “http://www.roblox.com/asset/?id=2761961”
end
keypad.B8.ClickDetector.MouseClick:connect(Click8)
function Click9()
Input = Input…9
print(“9”)
keypad.B9.Decal.Texture = “http://www.roblox.com/asset/?id=2767714”
wait(0.1)
keypad.B9.Decal.Texture = “http://www.roblox.com/asset/?id=2761971”
end
keypad.B9.ClickDetector.MouseClick:connect(Click9)