Here the client side is, please ignore most of these function’s.
repeat task.wait() until game:GetService("ReplicatedStorage"):FindFirstChild("FunctionStorage")
---------------------------------- || Variables || ----------------------------------
local field = {} ; playerStorage = {} ; self = setmetatable({},field) ; field.__index = field
local Services = require(script.Parent.Parent.Services)
local FunctionStorage = game:GetService("ReplicatedStorage"):WaitForChild("FunctionStorage")
local player = game.Players.LocalPlayer
---------------------------------- || Methods || ----------------------------------
function field:Convert(number)
local days = math.floor(number / (60 * 60 * 24)) % 7
local hours = math.floor(number / (60 * 60)) % 24
local minutes = math.floor(number / 60) % 60
local seconds = number % 60
local output = ""
if days > 0 then
output = output .. days .. "d "
end
if hours > 0 then
output = output .. hours .. "h "
end
if minutes > 0 then
output = output .. minutes .. "m "
end
output = output .. seconds .. "s"
return output
end
function field:GetInfoAsync()
self["Services"] = require(script.Parent.Parent.Services)
self["Stats"] = FunctionStorage:FindFirstChild("Request"):InvokeServer("Statistics")
task.wait()
if self["Stats"] == nil then
warn("Stats | Nil ", self["Stats"])
task.wait(0.8)
if self["Stats"] == nil then
field:GetInfoAsync()
end
end
task.wait()
self["UI"] = script.Parent.Parent.Parent
warn(self["Stats"])
self["UI"].Panel.Pages.Home.Stats.Likes.TextLabel.Text = self["Stats"].Likes
self["UI"].Panel.Pages.Home.Stats.Players.TextLabel.Text = self["Stats"].Visits
self["UI"].Panel.Pages.Home.Stats.Uptime.TextLabel.Text = field:Convert(math.floor(workspace.DistributedGameTime))
task.delay(1,function()
self:GetInfoAsync()
end)
end
function field:GlobalChat()
local GlobalChatService = Services.GlobalChatService
self["UI"] = script.Parent.Parent.Parent
self["UI"].Panel.Pages.Home.GlobalChat.Frame.Send.MouseButton1Click:Connect(function()
if playerStorage[player.UserId].db then if playerStorage[player.UserId].db == true then return end end
playerStorage[player.UserId].db = true
warn(self["UI"].Panel.Pages.Home.GlobalChat.Frame.TextBox.Text)
GlobalChatService:filter(self["UI"].Panel.Pages.Home.GlobalChat.Frame.TextBox.Text,player)
task.delay(3,function()
playerStorage[player.UserId].db = false
end)
end)
end
function field:AdminList()
local Admins = FunctionStorage:FindFirstChild("Request"):InvokeServer({["Dict"] = "Admins"})
task.wait(.7)
if Admins == nil then
warn("Admins is nil :()")
task.wait(.8)
field:AdminList()
end
self["UI"] = script.Parent.Parent.Parent
local Administrators = self["UI"].Panel.Pages.Home.Administrators
for _,admin in pairs(Admins) do
local ranks = require(script.Parent.Parent.Parent.Parent.Parent.Ranks)
if not ranks[admin.Rank] then continue end
local Clone = Administrators.ScrollingFrame.Template:Clone()
pcall(function()
Clone.ImageLabel.Image = game:GetService("Players"):GetUserThumbnailAsync(admin.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size352x352)
end)
Clone.TextLabel.Text = admin.Rank
Clone.You.Text = admin.Username
Clone.Parent = Administrators.ScrollingFrame
Clone.Visible = true
-- Add admin information (join date,name,description,e.c.t)
end
end
function field:AdminInformationList()
local Admins = FunctionStorage:FindFirstChild("Request"):InvokeServer({["Dict"] = "Admins"})
self["UI"] = script.Parent.Parent.Parent
local AdminInfo = self["UI"].Panel.Pages.Home.AdminInfo
for _,admin in pairs(Admins) do
local ranks = require(script.Parent.Parent.Parent.Parent.Parent.Ranks)
if not ranks[admin.Rank] then continue end
local Clone = AdminInfo.ScrollingFrame.Template:Clone()
pcall(function()
Clone.ImageLabel.Image = game:GetService("Players"):GetUserThumbnailAsync(admin.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size352x352)
end)
Clone.Rank.Text = admin.Rank
Clone:FindFirstChild("Name").Text = admin.Username
Clone.Parent = AdminInfo.ScrollingFrame
Clone.Visible = true
-- Add status
end
end
function field:Search()
local Commands = FunctionStorage:FindFirstChild("Request"):InvokeServer({["Dict"] = "Commands"})
local CustomCommandList = Commands[1]
local CommandList = Commands[2]
self["UI"] = script.Parent.Parent.Parent.Parent
self["UI"].Panel.Pages.Home.SearchBar.MouseButton1Click:Connect(function()
self["PopUp"] = script.Parent.Parent.UI.PopUps:FindFirstChild("Search"):Clone()
for _,Command in pairs(CommandList) do
self["Clone"] = self["PopUp"].Main.Container.Commands.Options.Template:Clone()
self["Clone"].Title.Text = Command.Name
self["Clone"].Name = Command.Name
self["Clone"].Parent = self["PopUp"].Main.Container.Commands.Options
self["Clone"].Visible = true
playerStorage[player.UserId].SelectedCommand = nil
self["Clone"].MouseButton1Click:Connect(function()
playerStorage[player.UserId].SelectedCommand = self["Clone"].Name
end)
self["PopUp"].Main.Container.Creator.Create.MouseButton1Click:Connect(function()
if playerStorage[player.UserId].SelectedCommand == nil then return end
local selectedCommand = playerStorage[player.UserId].SelectedCommand
CommandList[selectedCommand].Function(player)
end)
end
end)
end
---------------------------------- || RBX Signals || ----------------------------------
field:GetInfoAsync()
field:GlobalChat()
field:AdminList()
field:AdminInformationList()
field:Search()
return field