if not game:IsLoaded() then
game.Loaded:Wait()
end
if getgenv().CustomTopBarScriptLoaded then return end
getgenv().CustomTopBarScriptLoaded = true
local CG = game:GetService("CoreGui")
local Plrs = game:GetService("Players")
local RunSv = game:GetService("RunService")
local Stats = game:GetService("Stats")
local HttpSv = game:GetService("HttpService")
local LP = Plrs.LocalPlayer
local PGui = LP:WaitForChild("PlayerGui")
local MenAc = false
local StTim = os.clock()
local fileName = "topbar_time_played.json"
local placeIdStr = tostring(game.PlaceId)
local savedData = {}
local accumulatedTime = 0
if isfile and isfile(fileName) then
local ok, content = pcall(readfile, fileName)
if ok then
local ok2, parsed = pcall(function() return HttpSv:JSONDecode(content) end)
if ok2 and type(parsed) == "table" then
savedData = parsed
accumulatedTime = savedData[placeIdStr] or 0
end
end
end
task.spawn(function()
local lastSave = os.clock()
while true do
task.wait(1)
local now = os.clock()
local elapsed = now - StTim
StTim = now
accumulatedTime = accumulatedTime + elapsed
if now - lastSave >= 5 then
savedData[placeIdStr] = accumulatedTime
pcall(writefile, fileName, HttpSv:JSONEncode(savedData))
lastSave = now
end
end
end)
local TpStd = PGui:FindFirstChild("TopbarStandard")
local LftHd = TpStd and TpStd:FindFirstChild("Holders") and TpStd.Holders:FindFirstChild("Left")
local SGui
local BrCt = Instance.new("Frame")
BrCt.Name = "CustomTopBarBar"
BrCt.Size = UDim2.new(0, 132, 0, 44)
BrCt.BackgroundTransparency = 0.07999999821186066
BrCt.BackgroundColor3 = Color3.fromRGB(18, 18, 21)
BrCt.BorderSizePixel = 0
BrCt.ClipsDescendants = true
BrCt.ZIndex = 10
if LftHd then
BrCt.Parent = LftHd
else
SGui = Instance.new("ScreenGui")
SGui.Name = "CustomTopBarGui"
SGui.ResetOnSpawn = true
SGui.DisplayOrder = 99999
SGui.Parent = CG
BrCt.Parent = SGui
end
local Crn1 = Instance.new("UICorner")
Crn1.CornerRadius = UDim.new(1, 0)
Crn1.Parent = BrCt
local Lyt1 = Instance.new("UIListLayout")
Lyt1.FillDirection = Enum.FillDirection.Horizontal
Lyt1.SortOrder = Enum.SortOrder.LayoutOrder
Lyt1.VerticalAlignment = Enum.VerticalAlignment.Center
Lyt1.HorizontalAlignment = Enum.HorizontalAlignment.Left
Lyt1.Padding = UDim.new(0, 0)
Lyt1.Parent = BrCt
local function mkBtn(nm, ord, img)
local Btn = Instance.new("Frame")
Btn.Name = nm
Btn.Size = UDim2.new(0, 44, 0, 44)
Btn.BackgroundTransparency = 1
Btn.LayoutOrder = ord
Btn.ZIndex = 10
Btn.Parent = BrCt
local AOv = Instance.new("Frame")
AOv.Name = "ActOver"
AOv.Size = UDim2.new(1, 0, 1, 0)
AOv.BackgroundTransparency = 0.85
AOv.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
AOv.BorderSizePixel = 0
AOv.Visible = false
AOv.ZIndex = 11
AOv.Parent = Btn
local AOvCrn = Instance.new("UICorner")
AOvCrn.CornerRadius = UDim.new(1, 0)
AOvCrn.Parent = AOv
local Spt = Instance.new("Frame")
Spt.Name = "IconSpot"
Spt.Size = UDim2.new(1, 0, 1, 0)
Spt.BackgroundTransparency = 1
Spt.BorderSizePixel = 0
Spt.ZIndex = 12
Spt.Parent = Btn
local Cts = Instance.new("Frame")
Cts.Name = "Contents"
Cts.Size = UDim2.new(1, 0, 1, 0)
Cts.BackgroundTransparency = 1
Cts.BorderSizePixel = 0
Cts.ZIndex = 13
Plrs = game:GetService("Players")
Cts.Parent = Spt
local LyC = Instance.new("UIListLayout")
LyC.SortOrder = Enum.SortOrder.LayoutOrder
LyC.VerticalAlignment = Enum.VerticalAlignment.Center
LyC.HorizontalAlignment = Enum.HorizontalAlignment.Center
LyC.FillDirection = Enum.FillDirection.Horizontal
LyC.Padding = UDim.new(0, 3)
LyC.Parent = Cts
local Img1 = Instance.new("ImageLabel")
Img1.Name = "IconImage"
Img1.Size = UDim2.new(0, 24, 0, 24)
Img1.BackgroundTransparency = 1
Img1.BorderSizePixel = 0
Img1.ZIndex = 14
Img1.LayoutOrder = 2
Img1.Image = img
Img1.Parent = Cts
local Clk1 = Instance.new("TextButton")
Clk1.Name = "ClickRegion"
Clk1.Size = UDim2.new(1, 0, 1, 0)
Clk1.BackgroundTransparency = 1
Clk1.BorderSizePixel = 0
Clk1.ZIndex = 15
Clk1.Text = ""
Clk1.Parent = Btn
return Btn, Clk1, AOv
end
local MnBtn, MnClk, MnOv = mkBtn("MenuButton", 1, "rbxassetid://14219516515")
local RsBtn, RsClk, RsOv = mkBtn("ResetButton", 2, "rbxassetid://6723921202")
local LvBtn, LvClk, LvOv = mkBtn("LeaveButton", 3, "rbxassetid://9405925508")
local function mkPanel()
local Pn = Instance.new("ScrollingFrame")
Pn.Name = "CustomTopBarPanel"
Pn.Size = UDim2.new(0, 220, 0, 100)
Pn.CanvasSize = UDim2.new(0, 0, 0, 0)
Pn.AutomaticCanvasSize = Enum.AutomaticSize.Y
Pn.ScrollBarThickness = 4
Pn.BackgroundTransparency = 0.07999999821186066
Pn.BackgroundColor3 = Color3.fromRGB(18, 18, 21)
Pn.BorderSizePixel = 0
Pn.Visible = false
Pn.ZIndex = 20
Pn.ClipsDescendants = false
if not SGui then
SGui = Instance.new("ScreenGui")
SGui.Name = "CustomTopBarGui"
SGui.ResetOnSpawn = true
SGui.DisplayOrder = 99999
SGui.Parent = CG
end
Pn.Parent = SGui
local Crn2 = Instance.new("UICorner")
Crn2.CornerRadius = UDim.new(0, 16)
Crn2.Parent = Pn
local Pad1 = Instance.new("UIPadding")
Pad1.PaddingLeft = UDim.new(0, 16)
Pad1.PaddingTop = UDim.new(0, 14)
Pad1.PaddingRight = UDim.new(0, 16)
Pad1.PaddingBottom = UDim.new(0, 14)
Pad1.Parent = Pn
local Lyt2 = Instance.new("UIListLayout")
Lyt2.SortOrder = Enum.SortOrder.LayoutOrder
Lyt2.FillDirection = Enum.FillDirection.Vertical
Lyt2.Padding = UDim.new(0, 6)
Lyt2.Parent = Pn
local TmLb = Instance.new("TextLabel")
TmLb.Name = "TimeLabel"
TmLb.Size = UDim2.new(1, 0, 0, 22)
TmLb.BackgroundTransparency = 1
TmLb.TextColor3 = Color3.new(1, 1, 1)
TmLb.Font = Enum.Font.BuilderSansBold
TmLb.TextSize = 15
TmLb.TextXAlignment = Enum.TextXAlignment.Left
TmLb.TextYAlignment = Enum.TextYAlignment.Center
TmLb.LayoutOrder = 1
TmLb.ZIndex = 21
TmLb.Text = "Time Played: 00:00:00"
TmLb.Parent = Pn
local FpLb = Instance.new("TextLabel")
FpLb.Name = "FPSLabel"
FpLb.Size = UDim2.new(1, 0, 0, 22)
FpLb.BackgroundTransparency = 1
FpLb.TextColor3 = Color3.new(1, 1, 1)
FpLb.Font = Enum.Font.BuilderSansBold
FpLb.TextSize = 15
FpLb.TextXAlignment = Enum.TextXAlignment.Left
FpLb.TextYAlignment = Enum.TextYAlignment.Center
FpLb.LayoutOrder = 2
FpLb.ZIndex = 21
FpLb.Text = "FPS: --"
FpLb.Parent = Pn
local PgLb = Instance.new("TextLabel")
PgLb.Name = "PingLabel"
PgLb.Size = UDim2.new(1, 0, 0, 22)
PgLb.BackgroundTransparency = 1
PgLb.TextColor3 = Color3.new(1, 1, 1)
PgLb.Font = Enum.Font.BuilderSansBold
PgLb.TextSize = 15
PgLb.TextXAlignment = Enum.TextXAlignment.Left
PgLb.TextYAlignment = Enum.TextYAlignment.Center
PgLb.LayoutOrder = 3
PgLb.ZIndex = 21
PgLb.Text = "Ping: --ms"
PgLb.Parent = Pn
return Pn, TmLb, FpLb, PgLb
end
local Pnl, TmLb, FpLb, PgLb = mkPanel()
local function pstPnl()
Pnl.Position = UDim2.new(0, BrCt.AbsolutePosition.X, 0, BrCt.AbsolutePosition.Y + BrCt.AbsoluteSize.Y + 6)
end
local function getPng()
local ok, val = pcall(function()
return Stats.Network.ServerStatsItem["Data Ping"]:GetValueString()
end)
if not ok then return 0 end
local num = val:match("%d+%.?%d*")
return tonumber(num) or 0
end
RunSv.Heartbeat:Connect(function()
if not LftHd then
local trg
pcall(function()
trg = CG:FindFirstChild("TopBarApp"):FindFirstChild("TopBarApp"):FindFirstChild("UnibarLeftFrame"):FindFirstChild("UnibarMenu"):FindFirstChild("2")
end)
if trg then
BrCt.Position = UDim2.new(0, trg.AbsolutePosition.X + trg.AbsoluteSize.X + 10, 0, trg.AbsolutePosition.Y)
else
BrCt.Position = UDim2.new(0, 50, 0, 0)
end
end
if MenAc then
pstPnl()
end
end)
local FrCnt = 0
local LstTm = tick()
RunSv.RenderStepped:Connect(function()
if not MenAc then return end
FrCnt = FrCnt + 1
local Now = tick()
if Now - LstTm >= 1 then
local Fps = FrCnt / (Now - LstTm)
FpLb.Text = string.format("FPS: %.1f", Fps)
PgLb.Text = string.format("Ping: %dms", getPng())
FrCnt = 0
LstTm = Now
end
local Hrs = math.floor(accumulatedTime / 3600)
local Min = math.floor((accumulatedTime % 3600) / 60)
local Sec = math.floor(accumulatedTime % 60)
TmLb.Text = string.format("Time Played: %02d:%02d:%02d", Hrs, Min, Sec)
end)
MnClk.MouseButton1Click:Connect(function()
MenAc = not MenAc
Pnl.Visible = MenAc
if MenAc then
pstPnl()
end
end)
MnClk.MouseButton1Down:Connect(function()
MnOv.Visible = false
end)
MnClk.MouseButton1Up:Connect(function()
MnOv.Visible = MenAc
end)
MnClk.MouseEnter:Connect(function()
MnOv.Visible = true
end)
MnClk.MouseLeave:Connect(function()
MnOv.Visible = MenAc
end)
RsClk.MouseButton1Down:Connect(function()
RsOv.Visible = false
end)
RsClk.MouseButton1Up:Connect(function()
RsOv.Visible = true
end)
RsClk.MouseEnter:Connect(function()
RsOv.Visible = true
end)
RsClk.MouseLeave:Connect(function()
RsOv.Visible = false
end)
LvClk.MouseButton1Down:Connect(function()
LvOv.Visible = false
end)
LvClk.MouseButton1Up:Connect(function()
LvOv.Visible = true
end)
LvClk.MouseEnter:Connect(function()
LvOv.Visible = true
end)
LvClk.MouseLeave:Connect(function()
LvOv.Visible = false
end)
RsClk.MouseButton1Click:Connect(function()
local Plr = Plrs.LocalPlayer
local Chr = Plr.Character
if not Chr then return end
local Hum = Chr:FindFirstChild("Humanoid")
if not Hum then
print("Cant Reset, pls press reset in Roblox menu")
return
end
local function dn()
return Hum.Health <= 0 or Hum:GetState() == Enum.HumanoidStateType.Dead
end
Hum:ChangeState(Enum.HumanoidStateType.Dead)
task.wait(0.3)
if dn() then return end
Hum.Health = 0
task.wait(0.3)
if dn() then return end
Chr:BreakJoints()
task.wait(0.3)
if dn() then return end
print("Cant Reset, pls press reset in Roblox menu")
end)
LvClk.MouseButton1Click:Connect(function()
game:Shutdown()
end)
Comments
For Xeno users: Fuck off and get a normal executor