local player = game.Players.LocalPlayer
script.Parent.FocusLost:connect(function(enterPressed)
if enterPressed and script.Parent.Text == "U48f294Gq" and player.Code1.Value == false then
script.Parent.Text = "Giving Reward"
player.Points.Value = player.Points.Value + 2000
player.Code1.Value = true
wait(3)
script.Parent.Text = "Code Here....."
elseif enterPressed and script.Parent.Text ~= "U48f294Gq" then
script.Parent.Text = "Incorrect Passcode"
wait(3)
script.Parent.Text = "Code Here....."
elseif enterPressed and script.Parent.Text == "U48f294Gq" and player.Code1.Value == true then
script.Parent.Text = "Already entered Code"
wait(3)
script.Parent.Text = "Code Here....."
end
end)
This works in studio with Start Server. But when I play on an online server it says "Code already entered" even though I havent entered online yet. It is a localscript inside the TextBox. Anyone know?

1 comment
I did some tests. I did it for myself. It worked for me. Clearly you're creating the "Code1" value with it's value set to true by default. That's why.