local Player = script.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.FocusLost:connect(function(enterPressed)
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)
Ok, so I have this and if the player writes something other than 12345 it says Incorrecr code, but when they enter 12345 it dosent give them the points, and if they enter 12345 again it dosent say You have already entered Code. Do I need to change the way the if statements are placed? Inside normal script

18 comments
The money saves, etc but i would like a dif code every week, so they can only enter say code 123 once then they have to wait for next week to enter in the next code? Do I just change the saveboolean to be likehasEnteredCode1, then hasEnteredCode2?
Thanks for all the ways. I can rate up, but cant accept till i actually test which wont be till tomorrow
I guess you could, or you could make a time system using tick(), but I guess that'd be weird. :P
I have editted my question with what I am trying to test, please look at it
I had to edit my answer, sorry. I think it should work with that.
My code isnt gonna be 12345 :p just for testing purposes
still doing the same thing. Not giving points or saying already entered code.
could i just use tick()??
Output?
LocalScripts cannot use LoadBoolean..
If I made it serverscript then I couldnt use LocalPlayer for the top variable
...You never said it was a LocalScript. Don't use LoadBoolean. Use something like script.Parent.Parent.Parent.Parent.Parent. Basically, Thr script is something like this.... Player>PlayerGui>ScreenGui>Button>LocalScript. Make it not Local, and just use script.Parent.Parent.Parent... until you get the Player. Sorry, forgot about that. :c I'm pathetic...
its ok, im sorry, I just thought since it had LocalPlayer it meant LocalScript
I have put in a normalscript and done the script.Parent, etc to get to player, but it dosent work at all now. I have editted
...I have no idea what's happening to it. What's the Output? What do you mean "it doesnt work at all", and how did you edit it?
i just changed it to a normal script inside the textbutton and i change the player, i eddited my answer with it. Is there any actual way to get this working?
If you do it right it works. :p
i did do it right