Advertisement
Guest User

Untitled

a guest
Jul 5th, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. p = pc --password = passwordchange
  2. x = 50 --this is for the colors at the end.
  3. y = 100 --this too
  4. z = 255 --and also this
  5. n = tpt.get_name() --this gets the user's name
  6. tpt.message_box("The default password is: Password") --tells you the default password
  7. s = tpt.input("Authentication required.","Please authenticate that you are "..n,"Password") --asks it
  8. if s == p then --if s is equal to the input password, then
  9. c = tpt.input("Change password?","Y/N") --it asks to change password
  10. end
  11.  
  12.  
  13. if s == "Password" and pc == nil then--if it is the default pass and pc = nil then let you pass *
  14. pc = tpt.input("Password Change.","Enter new password here:") --prompts you for a new pass
  15. end
  16.  
  17. if s ~= p then--if the password is incorrect, display a message saying so.
  18. tpt.message_box("Authentication failed.", "Your authentication is incorrect. Try again.")
  19. os.exit() --then quit when you press OK
  20. end
  21.  
  22. if c == "Y" then --checks if you answered Y to the password change.
  23. pc = tpt.input("Password Change.","Enter new password here:") --if so it asks for a new password
  24. end
  25.  
  26. function Text()
  27. tpt.fillrect(237, 188, tpt.textwidth("Welcome, "..n.." to The Powder Toy!") + 5, 13, x, x, x) --making back
  28. tpt.drawtext(240, 191, "Welcome, "..n.." to The Powder Toy!", y, y, z) --adding text
  29. x = x - .1 --decay rates
  30. y = y - .2 --more
  31. z = z - .4 --more
  32. if z == 0 then--delete the box when all color is gone, otherwise it would hide part of the screen.
  33. tpt.unregister_step(Text) --same thing going on
  34. end
  35. end
  36.  
  37. tpt.register_step(Text) --run the function "Text" every frame
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement