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

How to get TextBox text working? [UNSOLVED]

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

0
Output? bbissell 346 — 10y
0
and is this a Local Script or no? bbissell 346 — 10y
0
not a localscript and there is no output NinjoOnline 1146 — 10y
0
Try Local Script raystriker6707 30 — 10y

1 answer

Log in to vote
1
Answered by
bbissell 346 Moderation Voter
10 years ago

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)
0
i shall check now NinjoOnline 1146 — 10y
0
i have editted with what I have got, but still nothing NinjoOnline 1146 — 10y
Ad

Answer this question