-- 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
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)