Hi there, I was making a Passcode GUI in my place and it seems that it does not work. The problem is that, It won't tell whether the Passcode is right or wrong and if the Passcode is correct, It won't remove the GUI. This script is placed in the StarterPack inside no Model or Part.
code = "EnterCodeHere"
Player = script.Parent.Parent.PlayerGui
Mouse = Player:GetMouse()
codegui = Player.PassCodeGUI
codeteller = codegui.PassCode.PassCodeTeller
codetype = codegui.PassCodeHere
function onKeyDown()
local key = key.lower()
if key:byte() == 13 then -- From this part it stops working.
if (codetype.Text == code) then
codeteller.Text = "Correct"
wait(2)
script.Parent.Parent.Character.Humanoid.WalkSpeed = 16
codegui:remove()
else
codeteller.Text = "Wrong"
wait(3)
codeteller.Text = "Enter Passcode"
end
end
end
Mouse.KeyDown:connect(onKeyDown)
This Script is a LocalScript. There are 3 frames. One is BackGround, Credits and PassCode. There is a NormalScript which makes the GUI visible.

2 comments
LocalScripts can't run inside Workspace... you need to put it in StarterGui or StarterPack..
Wait. Sorry I forgot that I placed the script in StarterPack. Sorry about that.