Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --script:Destroy()
- Banned = {}
- Ranks = {
- User = {},
- Moderator = {},
- Admin = {},
- Owner = {"CottenEyedMario"}
- }
- Commands = {
- User = {"cmds", "r", "m", "h", "info","Dismiss"},
- Moderator = {"cmds", "r", "kill", "jail", "m", "h", "info","Dismiss"},
- Admin = {"cmds", "r", "kill", "jail", "kick", "m", "h", "info","gethat","music", "remind","Dismiss"},
- Owner = {"cmds", "r", "kill", "jail", "kick", "m", "h", "info", "gethat", "music", "remind", "add", "remove", "rank", "Dismiss"}
- }
- function Output(tab, plyr, func)
- local Tablets = {}
- if workspace:findFirstChild("Hyperspace"..plyr.Name.."") then
- workspace:findFirstChild("Hyperspace"..plyr.Name..""):Destroy()
- end
- m = Instance.new("Model", workspace)
- m.Name = "Hyperspace"..plyr.Name..""
- for i = 1, #tab do
- local p = Instance.new("Part", m)
- p.Name = tostring(tab[i])
- p.Locked = true
- p.Size = Vector3.new(5, 4, 0.25)
- p.TopSurface, p.BottomSurface = "Smooth", "Smooth"
- p.Transparency = 0.5
- p.Anchored = true
- p.CanCollide = false
- p.BrickColor = BrickColor.new("Dark stone grey")
- local selectionBox = Instance.new("SelectionBox",p)
- selectionBox.Adornee = p
- selectionBox.Transparency = 0.5
- selectionBox.Color = BrickColor.new("Fossil")
- p.CFrame = plyr.Character.Torso.CFrame * CFrame.Angles(0, math.rad(i*#tab), 0)
- local bg = Instance.new("SurfaceGui", p)
- bg.Face = "Front"
- bg.CanvasSize = Vector2.new(500,500)
- bg.Adornee = p
- local frame = Instance.new("Frame", bg)
- frame.BackgroundTransparency = 1
- frame.Size = UDim2.new(1, 0, 1, 0)
- local tl = Instance.new("TextLabel", frame)
- tl.BackgroundTransparency = 1
- tl.Size = UDim2.new(1, 0, 1, 0)
- tl.TextWrapped = true
- tl.TextScaled = true
- tl.Text = tostring(tab[i])
- tl.TextStrokeTransparency = 0
- tl.TextStrokeColor3 = p.BrickColor.Color
- if script:findFirstChild(plyr.Name) then
- a = script:findFirstChild(plyr.Name)
- if a.Rank.Value == 1 then
- selectionBox.Color = BrickColor.new("Mauve")
- tl.TextStrokeColor3 = BrickColor.new("Mauve").Color
- elseif a.Rank.Value == 2 then
- selectionBox.Color = BrickColor.new("Bright yellow")
- tl.TextStrokeColor3 = BrickColor.new("Bright yellow").Color
- elseif a.Rank.Value == 3 then
- selectionBox.Color = BrickColor.new("Crimson")
- tl.TextStrokeColor3 = BrickColor.new("Crimson").Color
- elseif a.Rank.Value == 4 then
- selectionBox.Color = BrickColor.new(196)
- tl.TextStrokeColor3 = BrickColor.new(196).Color
- else
- end
- end
- if p.Name == "Dismiss" then
- p.BrickColor = BrickColor.new("Really red")
- selectionBox.Color = BrickColor.new("Really red")
- tl.TextStrokeColor3 = Color3.new(1, 0, 0)
- local cd = Instance.new("ClickDetector", p)
- cd.MaxActivationDistance = 500
- cd.MouseClick:connect(function(plr)
- if plr.Name == plyr.Name then
- if tl.Text == "Dismiss" then
- for i,v in pairs(Tablets) do
- table.remove(Tablets, i)
- game:GetService'RunService'.Heartbeat:wait()
- end
- for i,v in pairs(workspace["Hyperspace"..plyr.Name]:GetChildren()) do
- v:Destroy()
- wait()
- end
- end
- end
- end)
- else
- if func and p.Name ~= "Dismiss" then
- local cd = Instance.new("ClickDetector", p)
- cd.MaxActivationDistance = 500
- cd.MouseClick:connect(func)
- end
- end
- table.insert(Tablets, p)
- end
- local rot = 0
- if #Tablets >= 10 then
- local dist = #Tablets/2
- else
- local dist = 5
- end
- local rad = 4 + (#Tablets * 0.3) --Change if you want
- game:GetService'RunService'.RenderStepped:connect(function()
- rot = rot + 1
- for i,v in pairs(Tablets) do
- local x = math.sin((i / #Tablets - (0.3 / #Tablets) + rot * 2) * math.pi * 2) * rad
- local z = math.cos((i / #Tablets - (0.3 / #Tablets) + rot * 2) * math.pi * 2) * rad
- local arotation = Vector3.new(x, y, z) + plyr.Character.Torso.CFrame.p
- local brotation = v.CFrame.p
- local crotation = (arotation * .1 + brotation * .9)
- v.CFrame = CFrame.new(crotation, plyr.Character.Torso.CFrame.p) * CFrame.new(0, math.sin(rot/10)/50, dist)
- end
- end)
- end
- function fP(player)
- for i,v in pairs(game.Players:GetPlayers()) do
- if v.Name:match(player) then
- return v
- else
- return nil
- end
- end
- end
- function tC(table, val)
- for i,v in pairs(table) do
- if v:match(val) then
- return v
- else
- return nil
- end
- end
- end
- function SaveUser(UN, PW, RNK, PLYR, SENDER)
- plyr = fP(PLYR.Name)
- if plyr then
- accname = script:findFirstChild(plyr.Name)
- if accname then
- Output({"This user is already created an account", "Dismiss"}, SENDER)
- Output({"As a reminder, "..plyr.Name.." your credentials will be given to you now,", accname.Username.Value, accname.Password.Value, "Please don't forget to log in.", "Dismiss"}, plyr)
- else
- newUser = Instance.new("Folder", script)
- newUser.Name = plyr.Name
- UserName = Instance.new("StringValue", newUser)
- UserName.Name = "Username"
- UserName.Value = UN
- PassWord = Instance.new("StringValue", newUser)
- PassWord.Name = "Password"
- PassWord.Value = PW
- Rank = Instance.new("NumberValue", newUser)
- Rank.Name = "Rank"
- Rank.Value = RNK
- LoggedIn = Instance.new("BooleanValue", newUser)
- LoggedIn.Name = "Active"
- LoggedIn.Value = false
- if RNK == 1 then
- Output({"Welcome to Hyperspace!", "Please log in using 'login Username/Password'", "Use cmds to view all commands in your rank!", "USER: "..UN, "PASS: "..PW, "RANK: User", "Dismiss"}, plyr)
- elseif RNK == 2 then
- Output({"Welcome to Hyperspace!", "Please log in using 'login Username/Password'", "Use cmds to view all commands in your rank!", "USER: "..UN, "PASS: "..PW, "RANK: Moderator", "Dismiss"}, plyr)
- elseif RNK == 3 then
- Output({"Welcome to Hyperspace!", "Please log in using 'login Username/Password'", "Use cmds to view all commands in your rank!", "USER: "..UN, "PASS: "..PW, "RANK: Admin", "Dismiss"}, plyr)
- elseif RNK == 4 then
- Output({"Welcome to Hyperspace!", "Please log in using 'login Username/Password'", "Use cmds to view all commands in your rank!", "USER: "..UN, "PASS: "..PW, "RANK: Owner", "Dismiss"}, plyr)
- end
- end
- end
- end
- function firstUse(PLYR, RNK)
- plyr = fP(PLYR.Name)
- if plyr then
- Output({"Welcome to Hyperspace!", "Please create your account using the following command", "createnew Username/Password", "These messages will be removed once you have done so."}, plyr)
- OneTime = plyr.Chatted:connect(function(msg)
- if msg:sub(1,10) == "createnew " then
- bet1 = nil
- bet2 = nil
- for i = 1, msg:len() do
- if msg[i] == "/" then
- bet1 = msg:sub(11, i-1)
- bet2 = msg:sub(i+1)
- end
- end
- SaveUser(bet1, bet2, RNK, plyr)
- plyr.Chatted:connect(function(msg) oC(msg, plyr) end)
- OneTime:disconnect()
- end
- end)
- end
- end
- function logIn(PLYR, UN, PW)
- local plyr = fP(PLYR.Name)
- if plyr then
- if plyr.Name == PLYR then
- acc = script:findFirstChild(plyr.Name)
- if acc then
- if acc.Username.Value == UN and acc.Password.Value == PW then
- if acc.Active.Value == true then
- Output({"You are already logged into Hyperspace", "Dismiss"}, plyr)
- else
- acc.Active.Value = true
- Output({"Sucessfully logged into Hyperspace!", "Be wise and don't abuse!", "Dismiss"}, plyr)
- end
- else
- Output({"ERROR!", "Missing account and/or invalid credentials!", "Ask an admin / owner for a reminder!"}, plyr)
- end
- end
- end
- end
- end
- function logOut(PLYR, UN, PW)
- local plyr = fP(PLYR.Name)
- if plyr then
- if plyr.Name == PLYR then
- acc = script:findFirstChild(plyr.Name)
- if acc then
- if acc.Username.Value == UN and acc.Password.Value == PW then
- if acc.Active.Value == false then
- Output({"You are already logged out of Hyperspace", "Dismiss"}, plyr)
- else
- acc.Active.Value = false
- Output({"Sucessfully logged out of Hyperspace!", "Thanks for using the admin!", "Dismiss"}, plyr)
- end
- else
- Output({"ERROR!", "Missing account and/or invalid credentials!", "Ask an admin / owner for a reminder!"}, plyr)
- end
- end
- end
- end
- end
- function oC(msg, plyr)
- acc = script:findFirstChild(plyr)
- rnk = nil
- active = nil
- if acc then
- rnk = acc.Rank.Value
- active = acc.Active.value
- end
- if msg:sub(1, 6) == "login " then
- bet1 = nil
- bet2 = nil
- for i = 1, msg:len() do
- if msg:sub(i) == "/" then
- bet1 = msg:sub(7, i-1)
- bet2 = msg:sub(i+1)
- end
- end
- logIn(plyr, bet1, bet2)
- elseif msg:sub(1,7) == "logout " then
- bet1 = nil
- bet2 = nil
- for i = 1, msg:len() do
- if msg:sub(i) == "/" then
- bet1 = msg:sub(8, i-1)
- bet2 = msg:sub(i+1)
- end
- end
- logOut(plyr, bet1, bet2)
- elseif msg:sub(1,3) == "cmds" then
- if rnk == 1 then
- Output(Commands.User, plyr)
- elseif rnk == 2 then
- Output(Commands.Moderator, plyr)
- elseif rnk == 3 then
- Output(Commands.Admin, plyr)
- elseif rnk == 4 then
- Output(Commands.Owner, plyr)
- end
- end
- end
- for i,v in pairs(game.Players:GetPlayers()) do
- if tC(Ranks.User, v.Name) then
- firstUse(v, 1)
- elseif tC(Ranks.Moderator, v.Name) then
- firstUse(v, 2)
- elseif tC(Ranks.Admin, v.Name) then
- firstUse(v, 3)
- elseif tC(Ranks.Owner, v.Name) then
- firstUse(v, 4)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement