local par=script.Parent
local timer=par:WaitForChild'Timer'
local timerlabel=timer:WaitForChild'Time'
local timertitle=timer:WaitForChild'Title'
local SetTime = tick()
local RunService = game:GetService("RunService")
-- edit this like 0 digit = 1, 1 digit = 1.0, 2 digit = 1.00 3 digit = 1.000 etc
local RationalDigits = 2
function connectplrtouch(pt,func)
pt.Touched:Connect(function(t)
local c=game.Players.LocalPlayer.Character
if c and t:IsDescendantOf(c) then
func()
end
end)
end
local timer_active=false
local timer_time=0
local prev
for _,d in pairs(workspace:GetDescendants()) do
if d.Name=='Timer_Start' then
local name=(d:FindFirstChild'Title' and d.Title:IsA'StringValue' and d.Title.Value) or ''
connectplrtouch(d,function()
par.Enabled=true
if prev~=d then
SetTime = tick()
prev=d
end
timertitle.Text=name
timerlabel.TextColor3=Color3.new(1, 1, 1)
SetTime = tick()
timer_active=true
end)
end
if d.Name=='Timer_Pause' then
connectplrtouch(d,function()
timerlabel.TextColor3=Color3.new(0, 1, 0)
if timer_active == true then
game.ReplicatedStorage.ApplyTime:FireServer(timerlabel.Text)
end
timer_active=false
end)
end
if d.Name=='Timer_Stop' then
connectplrtouch(d,function()
par.Enabled=false
timerlabel.TextColor3=Color3.new(0, 1, 0)
timer_active=false
SetTime = tick()
end)
end
end
local Accuracy = 10^RationalDigits
function TimerFunc()
if timer_active then
local Div1 = math.abs(tick() - SetTime)
local CalculatedIncrement = math.round(Div1*Accuracy)/Accuracy
local Addons={}
for t=1,RationalDigits do
local i = t-1
local integer,predecimal = math.modf(CalculatedIncrement*(10^i))
local decimal = predecimal/(10^i)
if decimal == 0 then
Addons[t] = "0"
end
end
local NewText = tostring(CalculatedIncrement)
for i,v in pairs(Addons) do
NewText = NewText..v
end
timerlabel.Text=NewText
end
end
while true do
wait(.025)
TimerFunc()
end
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}