You could create a ClickDetector object inside the Part, then detect when that Part is clicked via the MouseClick Event in the ClickDetector
If you’ve already gotten your Timer Gui set up, all you’d just need to do is reference it (The nice thing about the MouseClick Event is that it has the Player as the first parameter, so you can just reference its PlayerGui easily)
After checking for the TimerGui, you can create a loop every second, which would slowly count down from the starting count (20), to the end count (0) while at the same time, changing the Timer’s Text:
local Part = script.Parent --This is where you would reference the Part
local ClickDetector = Part:WaitForChild("ClickDetector") --Checking to make sure that there's a ClickDetector inside the Part
local StartCountdown = 20
local EndCountdown = 0
local function StartCountdown(Player)
local PlayerGui = Player.PlayerGui
local TimerGui = PlayerGui:WaitForChild("TimerGui") --This is to ensure that there is a Timer Gui in your PlayerGui
for TimerStatus = StartCountdown, EndCountdown, -1 do
TimerGui.TextCountdown.Text = TimerStatus
wait(1)
end
TimerGui.TextCountdown.Text = "Timer Finished!"
end
ClickDetector.MouseClick:Connect(StartCountdown) --You'd need to Connect your Events in order for a function to properly work
I’d be more than happy to give you a place file example if you want, but here’s an example on what you could do