Text 2
Text 2
-- Create a ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = player:WaitForChild("PlayerGui")
-- Create a TextLabel
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(0, 200, 0, 50)
textLabel.Position = UDim2.new(1, -210, 0, 10) -- Adjusted to be at the top-right
corner
textLabel.AnchorPoint = Vector2.new(1, 0) -- Anchored to the top-right corner
textLabel.Text = "10:00"
textLabel.TextScaled = true
textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
textLabel.TextColor3 = Color3.new(1, 1, 1)
textLabel.Font = Enum.Font.SourceSans
textLabel.Parent = screenGui
textLabel.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or
input.UserInputType == Enum.UserInputType.Touch then
dragging = true
mousePos = input.Position
framePos = textLabel.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
textLabel.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
updateInput(input)
end
end)
-- Countdown loop
while countdownTime > 0 do
wait(1)
countdownTime = countdownTime - 1
textLabel.Text = formatTime(countdownTime)
end
rejoinGame()