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?

2 comments

0

Nothing LOOKS wrong. Check the console in online (F9 key) and give us any errors that are in it pertaining to this code. If there's no error, then it's a logic error.

0

nope nothing. if you enter some random thing it works saying that its incorrect but when you enter the actual code it says you have already enter that code?