-- Zamanlayıcı için GUI oluşturma local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui") local screenGui = Instance.new("ScreenGui", playerGui) local textLabel = Instance.new("TextLabel", screenGui) -- GUI'ı ayarlamak textLabel.Text = "" textLabel.TextSize = 60 textLabel.Font = Enum.Font.SourceSansBold -- TextLabela yazıyı yerleştirmek textLabel.Position = UDim2.new(0.5, 0, 0.1, 0) -- Başlangıç ve Bitiş bloklarının isimleri local baslangic_ismi = "Başlangıç" local bitis_ismi = "Bitiş" -- 2. KISIM -- Zamanlayıcıyı oluşturmak local sayacBasladi = false local baslamaZamani = 0 -- Nesnenin ismini oyunda aratan bir fonksiyon local function nesneBul(nesneAdi) return game.Workspace:WaitForChild(nesneAdi) end local function nesneKontrol(nesne) while true do if nesne then print("Nesne bulundu: " .. nesne.Name) nesne.Touched:Connect(function(dokunanparca) if dokunanparca.Parent.Name == game.Players.LocalPlayer.Name then if nesne.Name == baslangic_ismi then sayacBasladi = true baslamaZamani = os.clock() textLabel.TextColor3 = Color3.new(0, 0.3, 1) textLabel.Text = "Start!" elseif nesne.Name == bitis_ismi and sayacBasladi then sayacBasladi = false textLabel.TextColor3 = Color3.new(1, 0, 0) local bitisZamani = os.clock() local sure = bitisZamani - baslamaZamani local saniye = math.floor(sure) local milisaniye = math.floor((sure - saniye) * 100) local sonuc = string.format("%02d:%02d", saniye, milisaniye) textLabel.Text = "Zamanlamanız: "..sonuc.." saniye" end end end) return else wait(1) -- Bir sonraki aramadan önce 1 saniye bekleme end end end -- 3. KISIM -- Başlangıç nesnesini arayan bir coroutine çalıştırma coroutine.wrap(function() local baslangicBlok = nesneBul(baslangic_ismi) nesneKontrol(baslangicBlok) end)() -- Bitiş nesnesini arayan bir coroutine çalıştırma coroutine.wrap(function() local bitisBlok = nesneBul(bitis_ismi) nesneKontrol(bitisBlok) end)() -- Bu kod zamanlayıcıyı saniyenin her yüzde birinde günceliyor while wait(0.01) do if sayacBasladi then local saat = os.clock() local gecensure = saat - baslamaZamani local saniye = math.floor(gecensure) local milisaniye = math.floor((gecensure - saniye) * 100) textLabel.Text = string.format("%02d:%02d", saniye, milisaniye) end end