Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.48 KB | None | 0 0
  1. -- variables
  2. local frame = script.Parent.Frame
  3. local password = frame.Pass
  4. local username = frame.User
  5.     local main = frame.Main
  6.     local eframe = frame.EffectFrame
  7.  
  8. local player = script.Parent.Parent.Parent
  9.        
  10. local accountuser = game.ReplicatedStorage.PlayerAccount.UserUsername
  11. local accountpass = game.ReplicatedStorage.PlayerAccount.UserPassword
  12.  
  13.  
  14. local signup = frame.SignUp
  15.     local usersign = signup.UserSignUp
  16.     local passsign = signup.PassSignUp
  17.    
  18. local UserInputService = game:GetService("UserInputService")
  19.  
  20. effectNum = 50
  21. waitTime = 0.5
  22.  
  23. usercheck = false
  24. passcheck = false
  25. newuser = game.ReplicatedStorage.PlayerAccount.NewUser
  26.  
  27. -- login
  28. function newuserlogin()
  29. if accountpass.Value == "BLANK" and accountuser.Value == "BLANK" then
  30.     password.Visible = false
  31.     username.Visible = false
  32.     signup.Visible = true
  33.     newuser.Value = true
  34. end
  35.  
  36. accountuser.Value = usersign.Text
  37. accountpass.Value = passsign.Text
  38. end
  39.  
  40. -- input functions
  41. function enterPressed(input,gameProcessed)
  42. -- input.KeyCode == Enum.KeyCode.Return
  43. if password.Text == accountpass.Value and username.Text == accountuser.Value and input.KeyCode == Enum.KeyCode.Return then
  44.     print("A")
  45. end
  46.  
  47. local userlen = string.len(usersign.Text)
  48. local passlen = string.len(passsign.Text)
  49.  
  50. if userlen <= 3 and input.KeyCode == Enum.KeyCode.Return then
  51.     usersign.Text = "Username must be longer than 3 characters."
  52.     wait(2)
  53.     usersign.Text = "Enter Username Here"
  54. elseif userlen >= 25 and input.KeyCode == Enum.KeyCode.Return then
  55.     usersign.Text = "Username must be shorter than 25 characters."
  56.     wait(2)
  57.     usersign.Text = "Enter Username Here"  
  58. end
  59.  
  60. if passlen <= 3 and input.KeyCode == Enum.KeyCode.Return then
  61.     passsign.Text = "Password must be longer than 3 characters."
  62.     wait(2)
  63.     passsign.Text = "Enter Password Here"
  64. elseif passlen >= 25 and input.KeyCode == Enum.KeyCode.Return then
  65.     passsign.Text = "Password must be shorter than 25 characters."
  66.     wait(2)
  67.     passsign.Text = "Enter Password Here"    
  68. end
  69.    
  70. if userlen >= 3 and userlen <= 25 and usersign.Text == "Enter Username Here" == false and passlen >= 3 and passlen <= 25 and passsign.Text == "Enter Password Here" == false and input.KeyCode == Enum.KeyCode.Return then
  71.     signup.Visible = false
  72.     password.Visible = true
  73.     username.Visible = true
  74.     newuser.Value = false
  75. end
  76.  
  77. if gameProcessed then
  78.         print("\tThis input began on top of a GuiObject!")
  79.     else
  80.         print("\tThis input did not begin on top of a GuiObject!")
  81.     end
  82.  
  83. end
  84.  
  85. UserInputService.InputBegan:connect(enterPressed)
  86.  
  87.  
  88. -- background effects
  89. function createEffect()
  90.     local effect = Instance.new("Frame")
  91.     effect.Name = "effect"
  92.     effect.Parent = eframe
  93.     effect.Size = UDim2.new(0, 20, 0, 20)
  94.     effect.BackgroundColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
  95.     effect.BorderSizePixel = 0
  96.     effect.BackgroundTransparency = math.random()
  97.     effect.Position = UDim2.new(0, math.random(0, 1100), 0, math.random(0, 550))
  98.     effect:TweenPosition(UDim2.new(0, math.random(1100), 0, math.random(550)), "Out", "Linear", 5, false)
  99.     effect.Rotation = spawn(function ()
  100.     while wait(0.1) do
  101.         effect.Rotation = effect.Rotation + 10
  102.         end
  103.     end)
  104.    
  105.     return effect
  106.    
  107. end
  108.  
  109.  
  110. -- functions
  111. spawn(function ()
  112.     repeat wait(0.1)
  113.         newuserlogin()
  114.     until newuser.Value == false
  115. end)
  116.  
  117. spawn (function ()
  118. while true do wait(0.1)
  119. for i = 1,effectNum do
  120.     game:GetService("Debris"):AddItem(createEffect(),effectNum*waitTime)
  121.         wait(waitTime)
  122.         end
  123.     end
  124. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement