So I made an Door that opens if you type the right code but for some reason, if I type the right code it doesn’t open the door, how to fix this?
Heres the code
--[Variables]--
local Module = script.Parent
local Door = script.Parent.Metal_Door
local Numbers = script.Parent.Number
local OtherButtons = script.Parent.Other
local Configuration = script.Parent.Configuration
local Code = script.Parent.Code
local Text = script.Parent.Code_Text.Background_Text.SurfaceGui.TextLabel
local EnteredText = script.EnteredText
local Click = script.Click
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.5,Enum.EasingStyle.Back,Enum.EasingDirection.InOut,0,false,0)
local opendoor = tweenService:Create(Door, tweenInfo, {CFrame = script.Parent.CFrame_Door.CFrame})
--[Function]--
local function Clear()
Text.Text = ""
EnteredText.Value = Text.Text
end
for i, v in pairs(Numbers:GetChildren()) do
v.ClickDetector.MouseClick:Connect(function()
script.Click:Play()
if string.len(Text.Text) < string.len(Code.Value) then
Text.Text = Text.Text..v.Name
EnteredText.Value = Text.Text
else
Text.Text = v.Name
EnteredText.Value = Text.Text
end
end)
end
open = false
OtherButtons.Check.ClickDetector.MouseClick:Connect(function()
print("ACCESSED")
if EnteredText.Value == Code.Value then
script.Parent.Code_Text.Background_Text.Approved:Play()
open:Play()
Door.Door:Play()
Clear()
script.Approved:Play()
open = true
else
script:WaitForChild("Denied"):Play()
Clear()
end
end)
This is my first post btw