Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to get TextBox text working? [UNSOLVED]

-- Inside Script inside TextBox --
local Player = script.Parent.Parent.Parent.Parent.Parent.Parent
Player:WaitForDataReady()

script.Parent.FocusLost:connect(function(enterPressed)
	print("Test1")
    if enterPressed and script.Parent.Text == "123" and Player:LoadBoolean("testing") == false then
        Player.Points.Value = Player.Points.Value + 10000
        Player:SaveBoolean("testing", true)

    elseif enterPressed and script.Parent.Text ~= "123" then
        script.Parent.Text = "Incorrect Code"

    elseif enterPressed and script.Parent.Text == "123" and Player:LoadBoolean("testing") == true then
        script.Parent.Text = "You have already entered Code"
    end
end)

I have this (game>StarterGui>ShopGui>MainFrame>CodeFrame>CodeBox>Script) and it isn't working. There is no Output with errors. It isn't printing "Test1" so it isnt even doing the function.

- NinjoOnline

4 comments

0

Output?

0

and is this a Local Script or no?

0

not a localscript and there is no output

0

Try Local Script

1 answer

✓ Accepted answer

If this is a LocalScript, you are not able to use Data Persistence. However, If this is a regular script, you forgot to put in Player:WaitForDataReady() . If you do this, it should work. Please also post the output to better help the person answering the question.

local Player = script.Parent.Parent.Parent.Parent.Parent
Player:WaitForDataReady() -- Put it here

script.Parent.FocusLost:connect(function(enterPressed)

2 comments

0

i shall check now

0

i have editted with what I have got, but still nothing

This discussion is preserved as it was. New answers, comments, and votes are closed.