Playtime Open Source
Key RequiredUniversal

Playtime Open Source

Universal ScriptMeknoyuOfficialsMeknoyuOfficials 45 views 39 executesUpdated Jul 19, 2026
Unrated
00
Lua Script•112 lines (3629 chars)
local oldGui = game:GetService("CoreGui"):FindFirstChild("PlaytimeTrackerGui") or game:GetService("Players").LocalPlayer:FindFirstChildOfClass("PlayerGui"):FindFirstChild("PlaytimeTrackerGui")
if oldGui then oldGui:Destroy() end

local parentObject
local success, err = pcall(function()
    parentObject = game:GetService("CoreGui")
end)
if not success or not parentObject then
    parentObject = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
end

local screenGui = Instance.new("ScreenGui")
screenGui.Name = "PlaytimeTrackerGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = parentObject

local mainFrame = Instance.new("Frame")
mainFrame.Name = "MainFrame"
mainFrame.Size = UDim2.new(0, 180, 0, 120)
mainFrame.Position = UDim2.new(0.5, -90, 0.4, -60)
mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
mainFrame.BorderSizePixel = 0
mainFrame.Active = true
mainFrame.Parent = screenGui

local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0, 10)
uiCorner.Parent = mainFrame

local titleLabel = Instance.new("TextLabel")
titleLabel.Name = "TitleLabel"
titleLabel.Size = UDim2.new(1, 0, 0, 30)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "Playtime"
titleLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
titleLabel.Font = Enum.Font.SourceSansBold
titleLabel.TextSize = 14
titleLabel.Parent = mainFrame

local timeBox = Instance.new("Frame")
timeBox.Name = "TimeBox"
timeBox.Size = UDim2.new(0, 150, 0, 65)
timeBox.Position = UDim2.new(0.5, -75, 0.5, -15)
timeBox.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
timeBox.BorderSizePixel = 0
timeBox.Parent = mainFrame

local boxCorner = Instance.new("UICorner")
boxCorner.CornerRadius = UDim.new(0, 8)
boxCorner.Parent = timeBox

local timeLabel = Instance.new("TextLabel")
timeLabel.Name = "TimeLabel"
timeLabel.Size = UDim2.new(1, 0, 1, 0)
timeLabel.BackgroundTransparency = 1
timeLabel.Text = "00:00"
timeLabel.TextColor3 = Color3.fromRGB(0, 255, 150)
timeLabel.Font = Enum.Font.Code
timeLabel.TextSize = 28
timeLabel.Parent = timeBox

local userInputService = game:GetService("UserInputService")
local dragging, dragInput, dragStart, startPos

local function update(input)
    local delta = input.Position - dragStart
    mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end

mainFrame.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        startPos = mainFrame.Position
        
        input.Changed:Connect(function()
            if input.UserInputState == Enum.UserInputState.End then
                dragging = false
            end
        end)
    end
end)

mainFrame.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
        dragInput = input
    end
end)

userInputService.InputChanged:Connect(function(input)
    if input == dragInput and dragging then
        update(input)
    end
end)

local totalSeconds = 0
local MAX_SECONDS = 10 * 60 -- 10 menit

task.spawn(function()
    while mainFrame and mainFrame.Parent do
        task.wait(1)
        totalSeconds = totalSeconds + 1
        
        if totalSeconds >= MAX_SECONDS then
            totalSeconds = 0
        end
        
        local minutes = math.floor(totalSeconds / 60)
        local seconds = totalSeconds % 60
        timeLabel.Text = string.format("%02d:%02d", minutes, seconds)
    end
end)

Features & Information

Playtime Classic is for you play game all

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts