I'm trying to make this script with codes and if the player types in any of the code then the code Value will be set to 1 and it seems to me that its not working. Any suggestions or tips for me to fix this script? Thank you for your time!
local deb = false
local code = "Code1" , "Code2" --list of codes here that I wrote
local txtBox = script.Parent.Parent:WaitForChild("TextBox")
local CodeHolder = game.Players.LocalPlayer.Codes:FindFirstChild("Code1","Code2") --String values in players
script.Parent.MouseButton1Click:connect(function()
local plr = game.Players.LocalPlayer
if txtBox.Text == code and deb == false then --- I wrote this so that it will work if it finds matching code names
CodeHolder.Value = "1"
deb = true
txtBox.Text = "Code Accepted!"
else
txtBox.Text = "Invalid Code"
end
end)
