local Players = game:GetService("Players") local RunService = game:GetService("RunService") local TextService = game:GetService("TextService") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local screenGui = Instance.new("ScreenGui") screenGui.Name = "PlayTimeGui" screenGui.Parent = playerGui local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 200, 0, 60) frame.Position = UDim2.new(0, 10, 0, 10) frame.BackgroundColor3 = Color3.fromRGB(40, 40, 40) frame.BorderSizePixel = 0 frame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 8) corner.Parent = frame local label = Instance.new("TextLabel") label.Size = UDim2.new(1, 0, 1, 0) label.BackgroundTransparency = 1 label.Text = "Play Time: 00:00:00" label.TextColor3 = Color3.fromRGB(255, 255, 255) label.TextScaled = true label.Font = Enum.Font.Gotham label.Parent = frame local startTime = os.time() local connection local function updateTime() local currentTime = os.time() local elapsed = currentTime - startTime local hours = math.floor(elapsed / 3600) local minutes = math.floor((elapsed % 3600) / 60) local seconds = elapsed % 60 label.Text = string.format("Play Time: %02d:%02d:%02d", hours, minutes, seconds) end connection = RunService.Heartbeat:Connect(updateTime) player.PlayerRemoving:Connect(function() if connection then connection:Disconnect() end screenGui:Destroy() end)