You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Answer: I want a timer between to part using tick() or Os.Clock() , i want to make it to the millisecond -
What is the issue? Include screenshots / videos if possible!
Answer:Don’t Know how to achieve this
the Code:
local StartPart = game.Workspace.Startpart
local EndPart = game.Workspace.Endpart
local UpdateTextRemote = game.ReplicatedStorage.UpdateTextRemote
local PlayerTimers = {}
StartPart.Touched:Connect(function(hit)
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player and not PlayerTimers[Player] then
PlayerTimers[Player] = os.clock()
task.spawn(function()
while PlayerTimers[Player] do
UpdateTextRemote:FireClient(Player, "Timer: ("..os.clock() - PlayerTimers[Player]..")" )
task.wait()
end
end)
end
end)
EndPart.Touched:Connect(function(hit)
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if PlayerTimers[Player] then
print(os.clock() - PlayerTimers[Player])
PlayerTimers[Player] = nil
end
end)