Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- LightSpeed Admin developed by CottenEyedMario
- at HFWH. Version 0. Remind me how to script.
- ]]--
- AdminVersion = "LightSpeed dev0"
- Admins = {"CottenEyedMario"}
- LoggedIn = {}
- function cT(tbl, var)
- for i,v in pairs(tbl) do
- if v:match(var) then
- print(var.." found in table")
- return v
- end
- end
- end
- function SaveAcc(plyr, user, pass)
- if plyr then
- Account = Instance.new("Folder", plyr)
- Account.Name = "LightSpeed Account"
- User = Instance.new("StringValue", Account)
- User.Name = "Username"
- User.Value = user
- Pass = Instance.new("StringValue", Account)
- Pass.Name = "Password"
- Pass.Value = pass
- LoggedIn = Instance.new("BoolValue", Account)
- LoggedIn.Name = "LoggedIn"
- LoggedIn.Value = true
- print('SavedAccount')
- end
- end
- function PromptAccountCreation(plyr)
- PlyrGui = plyr.PlayerGui
- if plyr and PlyrGui then
- print("found")
- Prompt = Instance.new("ScreenGui", PlyrGui)
- Prompt.Name = "AccCreation"
- Frame = Instance.new("Frame", Prompt)
- Frame.Style = "DropShadow"
- Frame.Size = UDim2.new(0, 400, 0 ,200)
- Frame.Position = UDim2.new(0.35, 0, 0.25, 0)
- TextLabel = Instance.new("TextLabel", Frame)
- TextLabel.Size = UDim2.new(1, 0, 0, 35)
- TextLabel.Position = UDim2.new(0, 0, 0, 0)
- TextLabel.TextScaled = true
- TextLabel.Text = "Create a new Account, "..plyr.Name
- UserTextBox = Instance.new("TextBox", Frame)
- UserTextBox.TextScaled = true
- UserTextBox.Size = UDim2.new(0, 350, 0, 40)
- UserTextBox.Position = UDim2.new(0, 15, 0, 50)
- UserTextBox.Text = "Account Username"
- PassTextBox = Instance.new("TextBox", Frame)
- PassTextBox.TextScaled = true
- PassTextBox.Size = UDim2.new(0, 350, 0, 40)
- PassTextBox.Position = UDim2.new(0, 15, 0, 100)
- PassTextBox.Text = "Account Username"
- ButtonBox = Instance.new("TextButton", Frame)
- ButtonBox.TextScaled = true
- ButtonBox.Size = UDim2.new(0, 50, 0, 25)
- ButtonBox.Position = UDim2.new(0, 315, 0, 150)
- ButtonBox.Text = "Login"
- ButtonBox.MouseButton1Click:connect(function()
- SaveAcc(plyr, UserTextBox.Text, PassTextBox.Text)
- ButtonBox.Parent.Parent:Destroy()
- end)
- end
- end
- function FirstRun()
- for i,plyr in pairs(game.Players:GetPlayers()) do
- if cT(Admins, plyr.Name) then
- PromptAccountCreation(plyr)
- end
- end
- end
- FirstRun()
- function CheckLoggedIn(plyr)
- if plyr then
- Acc = plyr:findFirstChild("Account")
- if Acc then
- if Acc.LoggedIn.Value == true then
- return true
- print('Account Logged In')
- else
- return false
- print('Account Not Logged In')
- end
- else
- print('Account does not exist.')
- AccCr = plyr:findFirstChild("AccountCreation")
- if AccCr then
- print('Account is being created')
- wait(5)
- CheckLoggedIn(plyr)
- else
- if cT(Admins, plyr.Name) then
- PromptAccountCreation(plyr)
- print(plyr.Name.." has been prompted to make an account")
- else
- print('Player is not an admin')
- end
- end
- end
- else
- print('Player does not exsist')
- end
- end
- function oC(msg, plyr)
- if tC(Admins, plyr.Name) and CheckLoggedIn(plyr) then
- if msg:lower() == "test" then
- print('Test Message')
- end
- else
- plyr:Kick()
- end
- end
- for i,v in pairs(game.Players:GetPlayers()) do
- if tC(Admins, v.Name) then
- v.Chatted:connect(function(msg) oC(msg, v) end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement