0% found this document useful (0 votes)
7 views

Text

Uploaded by

Chicho J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Text

Uploaded by

Chicho J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

local TweenService = game:GetService("TweenService")

local player = game.Players.LocalPlayer


local playerGui = player:WaitForChild("PlayerGui")
local camera = game.Workspace.CurrentCamera -- Get the current camera

-- Create the ScreenGui and Timer Frame


local screenGui = Instance.new("ScreenGui")
screenGui.Parent = playerGui
screenGui.ResetOnSpawn = false -- Keep the GUI even when respawning

local timerFrame = Instance.new("Frame")


timerFrame.Size = UDim2.new(0, 350, 0, 120) -- Slightly larger for a more premium
feel
timerFrame.Position = UDim2.new(1, -360, 0, 50) -- Adjust to top-right corner with
padding
timerFrame.BackgroundTransparency = 1 -- Make the background completely invisible
timerFrame.Parent = screenGui

-- Add a subtle drop shadow effect to the frame


local shadow = Instance.new("ImageLabel")
shadow.Size = UDim2.new(1, 10, 1, 10)
shadow.Position = UDim2.new(0, 5, 0, 5)
shadow.BackgroundTransparency = 1
shadow.Image = "rbxassetid://413195285" -- Built-in shadow asset
shadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
shadow.ImageTransparency = 0.5
shadow.Parent = timerFrame

-- Create a TextLabel to display the timer


local timerLabel = Instance.new("TextLabel")
timerLabel.Size = UDim2.new(1, 0, 1, 0) -- Same size as the timerFrame
timerLabel.Position = UDim2.new(0, 0, 0, 0)
timerLabel.BackgroundTransparency = 1 -- Make background transparent
timerLabel.TextColor3 = Color3.fromRGB(255, 255, 255) -- Set text color to white
timerLabel.TextScaled = true -- Automatically scale text to fit the label
timerLabel.Font = Enum.Font.GothamBold -- Use a bold font for a premium look
timerLabel.Text = "05:00" -- Initial time display (5 minutes)
timerLabel.TextStrokeTransparency = 0.8 -- Add a stroke to text for better
readability
timerLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0) -- Dark stroke
timerLabel.Parent = timerFrame

-- TweenService: Create some animations for the GUI elements


local frameTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quint,
Enum.EasingDirection.Out)
local labelTweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Bounce,
Enum.EasingDirection.Out)

-- Animation for the timer frame to fade in smoothly


local frameTweenGoal = {BackgroundTransparency = 0.4, Position = UDim2.new(1, -360,
0, 50)} -- Fade and slide into position
local frameTween = TweenService:Create(timerFrame, frameTweenInfo, frameTweenGoal)

-- Animation for the timer label to scale up slightly


local labelTweenGoal = {TextTransparency = 0, TextSize = 50}
local labelTween = TweenService:Create(timerLabel, labelTweenInfo, labelTweenGoal)

-- Countdown Timer logic


local countdownTime = 300 -- 5 minutes in seconds
-- Create the blur effect for the camera
local blurEffect = Instance.new("BlurEffect")
blurEffect.Parent = camera
blurEffect.Enabled = false -- Start with blur disabled
blurEffect.Size = 0 -- Set initial blur to 0

-- Function to update blur size dynamically based on the timer


local function updateBlur()
-- Gradually increase blur intensity during the countdown
local progress = countdownTime / 300
blurEffect.Size = math.min(20, 10 + (10 * (1 - progress))) -- Maximum blur
size is 20
end

local function formatTime(seconds)


local minutes = math.floor(seconds / 60)
local remainingSeconds = seconds % 60
return string.format("%02d:%02d", minutes, remainingSeconds)
end

-- Smooth animation for text color change


local function updateTimer()
-- Play animations as the GUI appears
frameTween:Play()
labelTween:Play()

while countdownTime > 0 do


-- Update the timer label with formatted time
timerLabel.Text = formatTime(countdownTime)

-- Update blur size based on countdown progress


updateBlur()

-- Smoothly change the text color based on the remaining time


local progress = countdownTime / 300 -- How much time is left (0 to 1)
local red = (1 - progress) * 255
local green = progress * 255
local transitionColor = Color3.fromRGB(red, green, 0)

-- Tween the text color change for smoothness


local colorTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear,
Enum.EasingDirection.Out)
local colorTweenGoal = {TextColor3 = transitionColor}
local colorTween = TweenService:Create(timerLabel, colorTweenInfo,
colorTweenGoal)
colorTween:Play()

-- Wait for one second before updating again


wait(1)
countdownTime = countdownTime - 1
end

-- When the countdown finishes, show "Time's Up!" with a red color and fade out
effect
timerLabel.Text = "00:00"
local endColorTween = TweenService:Create(timerLabel, TweenInfo.new(1),
{TextColor3 = Color3.fromRGB(255, 0, 0)})
endColorTween:Play()
end

-- Start the countdown with animations


updateTimer()

You might also like