Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

TextBox not working in online mode?

Asked by 10 years ago
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?

0
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. Tkdriverx 514 — 10y

Answer this question