How can I make a timer appear when player touches part

Im making a time trial based platformer and I want a timer to start when a player touches a part and that same timer to stop when a player touches another part

so bassicly a ui that is invisible and when a player touches a “Start” part then it will make the ui visible and start counting down from a specific amount of seconds lets say 10

how can I do this? I know how to make the ui visible but how could I make it count down? and then stop when the player touches another part

thanks for the help I can provide a script if needed

1 Like

Roblox would like for you to provide your script with the problem so it doesn’t seem like you are using people for scripts. But here is something that could work.

startButton = script.Parent
startButton.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChildWhichIsA("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.PlayerGui["SCREEN GUI NAME HERE"].Enabled = true
end
end)

This script will only make the timer show, but not run. I have had many problems with making timers in the past and all my solutions didn’t work.
Make sure to put the script inside the button.

2 Likes

thanks ill try and provide my script