Advertisement
Guest User

Untitled

a guest
Aug 19th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. --[[
  2.  
  3. LightSpeed Admin developed by CottenEyedMario
  4. at HFWH. Version 0. Remind me how to script.
  5.  
  6. ]]--
  7. AdminVersion = "LightSpeed dev0"
  8. Admins = {"CottenEyedMario"}
  9. LoggedIn = {}
  10.  
  11. function cT(tbl, var)
  12. for i,v in pairs(tbl) do
  13. if v:match(var) then
  14. print(var.." found in table")
  15. return v
  16. end
  17. end
  18. end
  19.  
  20. function SaveAcc(plyr, user, pass)
  21. if plyr then
  22. Account = Instance.new("Folder", plyr)
  23. Account.Name = "LightSpeed Account"
  24. User = Instance.new("StringValue", Account)
  25. User.Name = "Username"
  26. User.Value = user
  27. Pass = Instance.new("StringValue", Account)
  28. Pass.Name = "Password"
  29. Pass.Value = pass
  30. LoggedIn = Instance.new("BoolValue", Account)
  31. LoggedIn.Name = "LoggedIn"
  32. LoggedIn.Value = true
  33. print('SavedAccount')
  34. end
  35. end
  36.  
  37. function PromptAccountCreation(plyr)
  38. PlyrGui = plyr.PlayerGui
  39. if plyr and PlyrGui then
  40. print("found")
  41. Prompt = Instance.new("ScreenGui", PlyrGui)
  42. Prompt.Name = "AccCreation"
  43. Frame = Instance.new("Frame", Prompt)
  44. Frame.Style = "DropShadow"
  45. Frame.Size = UDim2.new(0, 400, 0 ,200)
  46. Frame.Position = UDim2.new(0.35, 0, 0.25, 0)
  47. TextLabel = Instance.new("TextLabel", Frame)
  48. TextLabel.Size = UDim2.new(1, 0, 0, 35)
  49. TextLabel.Position = UDim2.new(0, 0, 0, 0)
  50. TextLabel.TextScaled = true
  51. TextLabel.Text = "Create a new Account, "..plyr.Name
  52. UserTextBox = Instance.new("TextBox", Frame)
  53. UserTextBox.TextScaled = true
  54. UserTextBox.Size = UDim2.new(0, 350, 0, 40)
  55. UserTextBox.Position = UDim2.new(0, 15, 0, 50)
  56. UserTextBox.Text = "Account Username"
  57. PassTextBox = Instance.new("TextBox", Frame)
  58. PassTextBox.TextScaled = true
  59. PassTextBox.Size = UDim2.new(0, 350, 0, 40)
  60. PassTextBox.Position = UDim2.new(0, 15, 0, 100)
  61. PassTextBox.Text = "Account Username"
  62. ButtonBox = Instance.new("TextButton", Frame)
  63. ButtonBox.TextScaled = true
  64. ButtonBox.Size = UDim2.new(0, 50, 0, 25)
  65. ButtonBox.Position = UDim2.new(0, 315, 0, 150)
  66. ButtonBox.Text = "Login"
  67. ButtonBox.MouseButton1Click:connect(function()
  68. SaveAcc(plyr, UserTextBox.Text, PassTextBox.Text)
  69. ButtonBox.Parent.Parent:Destroy()
  70. end)
  71. end
  72. end
  73.  
  74. function FirstRun()
  75. for i,plyr in pairs(game.Players:GetPlayers()) do
  76. if cT(Admins, plyr.Name) then
  77. PromptAccountCreation(plyr)
  78. end
  79. end
  80. end
  81.  
  82. FirstRun()
  83.  
  84. function CheckLoggedIn(plyr)
  85. if plyr then
  86. Acc = plyr:findFirstChild("Account")
  87. if Acc then
  88. if Acc.LoggedIn.Value == true then
  89. return true
  90. print('Account Logged In')
  91. else
  92. return false
  93. print('Account Not Logged In')
  94. end
  95. else
  96. print('Account does not exist.')
  97. AccCr = plyr:findFirstChild("AccountCreation")
  98. if AccCr then
  99. print('Account is being created')
  100. wait(5)
  101. CheckLoggedIn(plyr)
  102. else
  103. if cT(Admins, plyr.Name) then
  104. PromptAccountCreation(plyr)
  105. print(plyr.Name.." has been prompted to make an account")
  106. else
  107. print('Player is not an admin')
  108. end
  109. end
  110. end
  111. else
  112. print('Player does not exsist')
  113. end
  114. end
  115.  
  116. function oC(msg, plyr)
  117. if tC(Admins, plyr.Name) and CheckLoggedIn(plyr) then
  118. if msg:lower() == "test" then
  119. print('Test Message')
  120. end
  121. else
  122. plyr:Kick()
  123. end
  124. end
  125.  
  126. for i,v in pairs(game.Players:GetPlayers()) do
  127. if tC(Admins, v.Name) then
  128. v.Chatted:connect(function(msg) oC(msg, v) end)
  129. end
  130. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement