Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Name: Multi Game Admin
- -- Date: 1:09 AM 8/10/2014
- -- By: dogwarrior24
- --[[
- for i,v in pairs(Data:GetAllData()) do
- Data:DeleteValue(i)
- end
- --]]
- local Data = require(167431702) -- asset id of the rbxdatabase module
- local Key = "d418e8dfa7275c99421851a5cd88ee6f" -- your api key
- Data:Connect(Key)
- set = function(n,v) Data:SetValue(n,v) end
- get = function() return Data:GetAllData() end
- Services = setmetatable({},{__index = function(a,b) return pcall(function() return game:GetService(b) end) and game:GetService(b) or nil end})
- MPS = game:service'MarketplaceService'
- gameTab = {}
- Admins = {
- ["dogwarrior24"]=true
- }
- AdminP = {}
- Players = {}
- function NewAdmin(p)
- print("New admin "..tostring(p))
- local ad = {}
- function ad:Update()
- if p:WaitForChild("PlayerGui") and (not ad.Gui or not ad.Gui:IsDescendantOf(p)) then
- ad.Gui = Instance.new("ScreenGui",p.PlayerGui)
- ad.Gui.Name = 'admin'
- else
- ad.Gui = ad.Gui or Instance.new("ScreenGui")
- end
- end
- table.insert(AdminP,ad)
- ad:Update()
- return ad
- end
- function ACheck(v)
- if Admins[v.Name] then
- NewAdmin(v)
- end
- Players[v.Name]={Name=v.Name,AccountAge=v.AccountAge,userId=v.userId}
- end
- for i,v in pairs(game.Players:GetPlayers()) do
- ACheck(v)
- end
- game.Players.PlayerAdded:connect(function(v)
- ACheck(v)
- end)
- game.Players.PlayerRemoving:connect(function(v)
- pcall(function() table.remove(Players,v.Name) end)
- end)
- while wait(5) do
- print'update'
- local PlaceAsset = MPS:GetProductInfo(game.PlaceId)
- gameTab.Description = PlaceAsset.Description
- gameTab.Name = tostring(PlaceAsset.Name)
- gameTab.Players = Players
- set(tostring(game.PlaceId),gameTab)
- hax = get()
- for i,v in pairs(AdminP) do
- v:Update()
- v.Gui:ClearAllChildren()
- for _,g in pairs(hax) do
- for h,n in pairs(g.Players or {}) do
- local N = Instance.new("TextLabel",v.Gui)
- N.Text = n.Name
- N.Size = UDim2.new(0,100,0,20)
- N.Position = UDim2.new(0.5,-N.TextBounds.X/2,0,#v.Gui:GetChildren()*20)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement