HI! Ewof here, and I have a problem. You see, when I try to enter a code, it doesn’t work, even if it is the correct code.
Here’s the script:
local Code = math.random(1000, 9999)
local Input = script.Parent.Code
local InputPlane = script.Parent.Safe.Input.SurfaceGui.Frame.TextLabel
local Paper = script.Parent.Paper.SurfaceGui.Frame.Code
local clear = script.Parent.Safe.Clear.ProximityPrompt
local enter = script.Parent.Safe.Enter.ProximityPrompt
Paper.Text = Code
function Clear()
Input.Value = ""
InputPlane.Text = Input.Value
end
clear.Triggered:connect(Clear)
function Enter()
if Input.Value == Code then
InputPlane.TextColor3 = Color3.new(0, 1, 0)
InputPlane.Text = "CORRECT"
else
InputPlane.Text = "INCORRECT"
InputPlane.TextColor3 = Color3.new(1, 0, 0)
wait(3)
InputPlane.Text = "TRY AGAIN"
InputPlane.TextColor3 = Color3.new(1, 1, 1)
end
end
enter.Triggered:connect(Enter)
Here’s a video:
More things:
- The typing of the input and the input box itself (safe) are connected by this code
local screenGui = script.Parent -- the code is in a local script.
local InputBox = screenGui.Frame.TextboxHolder.TextBox
local OutputBox = game.Workspace.SafeSystem.Safe.Input.SurfaceGui.Frame.TextLabel
InputBox.FocusLost:Connect(function(PressedEnter)
if PressedEnter then
OutputBox.Text = InputBox.Text
end
end)
- The value that I use is a StringValue
- The text works fine, but the entering of code doesn’t
If anyone can help, I would highly appreciate it, ty!