How to Make a Timer GUI - Roblox Studio Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ม.ค. 2025

ความคิดเห็น • 197

  • @asztraa
    @asztraa 4 ปีที่แล้ว +6

    Omg Lol I was looking for something like this for my game but i forgot now what kind of game I was making. Liking this video so if I remember Ill continue it! Thank youuuuuuuuuuuuu

  • @danblair4874
    @danblair4874 4 ปีที่แล้ว +8

    This is exactly what I needed for my speed running game too.
    Please do not stop doing these videos. Your topics are relatable and practical, and your style of teaching is easy to follow. You are always my go to channel when I am researching a topic for Roblox studio.
    Thank you.

  • @dylankurtz1121
    @dylankurtz1121 4 ปีที่แล้ว +17

    That’s weird, this is exactly what I needed for my game. Thanks!

  • @abomination1456
    @abomination1456 4 ปีที่แล้ว

    Thanx a lot this is what I really needed for my game :D
    People like you should get more recognition as you are helping the Roblox Community make games!

  • @heypikachu276
    @heypikachu276 3 ปีที่แล้ว +1

    I've seen a few people wanting to reverse this. Here's how you would do it:
    1. Set time_val to 0
    2. Set > 0 to < 10
    3. Set "time_num = time_num - 1" to "time_num = time_num -+ 1"

  • @NotZDH
    @NotZDH 3 ปีที่แล้ว +1

    Thanks Mike. You made my Metroid inspired escape sequence more intense!
    To people saying the code is outdated, as of 12/28/21, it still works

    • @timeanchorgamer527
      @timeanchorgamer527 3 ปีที่แล้ว

      well as of 1/4/22 it DOESNT work

    • @NotZDH
      @NotZDH 3 ปีที่แล้ว

      @@timeanchorgamer527 I guess it sucks to be you then. It still works

    • @dogking7441
      @dogking7441 2 ปีที่แล้ว

      it didnt work for me but tbh for the code part I copied it from his description :/

    • @branchfromwish
      @branchfromwish ปีที่แล้ว +1

      as of 11/15/2023 it still works xD

  • @r41nar
    @r41nar 4 ปีที่แล้ว +3

    Thanks! If you wan't to teleport the player if the time runs out, here is the part you change - player.Character.Humanoid.Health = 0 LowerTorso = player.Character.LowerTorso
    LowerTorso.CFrame = game.Workspace.NameOfPartToTeleportTo.CFrame

  • @rainbowoof
    @rainbowoof 4 ปีที่แล้ว +1

    Im so excited everytime u make a new video... Because about each tutorial you make could help me in my future games. :)

  • @wumtus4734
    @wumtus4734 4 ปีที่แล้ว +2

    You"re amazing! you do topics that I need for my game! Well done.

  • @esaedits8754
    @esaedits8754 4 ปีที่แล้ว +4

    thank you! heres the script: (i did 60 seconds, you can change it)
    local start = game.Workspace.Start
    local stop = game.Workspace.Stop
    local time_val = 60
    local timer_started = false
    local completed = false
    local time_label = script.Parent
    time_label.Visible = false
    local LPlayer = game.Players.LocalPlayer
    local function start_Timer(otherPart)
    local player = game.Players:FindFirstChild(otherPart.Parent.Name)
    if player.Name == LPlayer.Name and not timer_started then
    timer_started = true
    time_label.Text = time_val
    player.PlayerGui.Timer.Label.Visible = true
    local time_num = tonumber(player.PlayerGui.Timer.Label.Text)
    while time_num > 0 do
    wait(1)
    time_num = time_num - 1
    player.PlayerGui.Timer.Label.Text = tostring(time_num)
    end
    if not completed then
    player.PlayerGui.Timer.Label.Visible = false
    player.Character.Humanoid.Health = 0
    end
    timer_started = false
    completed = false
    player.PlayerGui.Timer.Label.Text = time_val
    end
    end
    local function finish_timer(otherPart)
    local player = game.Players:FindFirstChild(otherPart.Parent.Name)
    if player.Name == LPlayer.Name then
    player.PlayerGui.Timer.Label.Visible = false
    completed = true
    end
    end
    start.Touched:Connect(start_Timer)
    stop.Touched:Connect(finish_timer)

  • @flimflam3916
    @flimflam3916 4 ปีที่แล้ว

    How to make a Main Menu on the beginning of the game and where u click "Play", "....", "...." and when u move your mouse on bottoms it makes noise and u can customize it. And when you click play there's a typing sentences and it makes keyboard typing noises. Keep up the good work! :)

  • @tylerhuff7394
    @tylerhuff7394 2 ปีที่แล้ว +2

    This code seems to have an error where it cannot restart the timer if the player walks back and touches the green part. This can be fixed by adding:
    timer_started = false
    to the stop_timer function.
    EX:
    if player.Name == LPlayer.Name then
    player.PlayerGui.Timer.Label.Visible = false
    completed = true
    timer_started = false
    end

  • @mrblueanimationmanz2261
    @mrblueanimationmanz2261 3 ปีที่แล้ว

    This is litterally exactly what I needed!
    Thanks a million!

  • @gucci_prodz
    @gucci_prodz ปีที่แล้ว

    Thank you so much mike! I needed this exact script for my game and you delivered! Im dropping a sub.

  • @huskitroop748
    @huskitroop748 4 ปีที่แล้ว

    This is literally exactly what I wanted! Thank you!

  • @RJGamesMoviesandMore
    @RJGamesMoviesandMore 4 ปีที่แล้ว +2

    Is there any way to do this, but the numbers go up until you touch another part?

  • @branchfromwish
    @branchfromwish ปีที่แล้ว

    You are awesome! Thank you so much, this helped a lot!!

  • @buildersclub3773
    @buildersclub3773 3 ปีที่แล้ว +1

    Thank u i was trying to make a timer for my game “Bow Auto”

  • @cjlegoman3502
    @cjlegoman3502 3 ปีที่แล้ว

    Dude, U JUST GAVE ME THE BEST IDEA FOR MAY GAME OMG

  • @user-ed5cf8ku7e
    @user-ed5cf8ku7e 4 ปีที่แล้ว +4

    Thanke so much :D
    Edit wow this is epic
    Edit 2 second
    Edit 3 most edits

  • @legal304
    @legal304 3 ปีที่แล้ว +1

    Dude what's inside the start and stop blocks? this is driving me crazy, thank

  • @shotokanjuul2191
    @shotokanjuul2191 4 ปีที่แล้ว +3

    Can you now make a video about a count from 1 to 10 instead of 10 to 1?

  • @realmuslim6097
    @realmuslim6097 4 ปีที่แล้ว

    I was gonna make a stopwatch but I can work from this and its a great tutorial by the way

  • @patrik2295
    @patrik2295 3 ปีที่แล้ว

    Thank you! You helped me in a lot of things.

  • @inventors631
    @inventors631 4 ปีที่แล้ว +1

    dude this helped so much thx

  • @west8772
    @west8772 4 ปีที่แล้ว +1

    in time num = time num - 1, you could do time_num -= 1

  • @FNeditz69
    @FNeditz69 3 ปีที่แล้ว

    You are the best thanks for helping me out you deserve more subs

  • @grahlv
    @grahlv 3 ปีที่แล้ว +1

    I did the exact same script up to 35 lines and it doesn't work when I touch it the time shows up but doesn't countdown or do anything

  • @wendysbrenes9833
    @wendysbrenes9833 4 ปีที่แล้ว +1

    thanks for helping me and good video

  • @trainproductions-8889
    @trainproductions-8889 4 ปีที่แล้ว +1

    Thank you mike. You’re one of the only coding tutorial channels that work and it’s really helping me make my 2d platformer.

  • @Fishy883
    @Fishy883 4 ปีที่แล้ว +5

    This is a good script, but I know your tired of questions, but how do you make it count up instead of down?

    • @heypikachu276
      @heypikachu276 3 ปีที่แล้ว

      You add a + instead of a minus, make the greater than 0 a less than 10, and you make the timerValue 0

    • @heypikachu276
      @heypikachu276 3 ปีที่แล้ว

      Basically just reversing the script.

    • @Fishy883
      @Fishy883 3 ปีที่แล้ว

      @@heypikachu276 Cool! Thing is that my comment is 8 months old, so I don't need it. Still it is epic.

  • @dusanmann
    @dusanmann 3 ปีที่แล้ว

    Thank you for the timer

  • @ethansherwood5467
    @ethansherwood5467 4 ปีที่แล้ว +3

    are you going to be playing some more of your subscribers games? And if so, is there a place i could submit mine?

    • @TechwithMikeYT
      @TechwithMikeYT  4 ปีที่แล้ว +1

      Yes, please check the community section

  • @mizies
    @mizies 4 ปีที่แล้ว +3

    how to make it a stop watch/timer? like jtoh

    • @rejubila4239
      @rejubila4239 3 ปีที่แล้ว

      Thats what im looking for for like 1 month

  • @JohnworfRoblox
    @JohnworfRoblox 3 ปีที่แล้ว +1

    could u make a video on how to make like a clock at the top of your screen?? ((like in bloxburg))

  • @satriakanesantoso
    @satriakanesantoso 3 ปีที่แล้ว

    Thanks buddy apprecioate it!

  • @SEANPLAYZYT
    @SEANPLAYZYT 4 ปีที่แล้ว +1

    will it respawn you when the timer is finished pls make a script on that pls

  • @Keketin
    @Keketin 2 ปีที่แล้ว

    Keep up the good work. :D

  • @erold2015
    @erold2015 4 ปีที่แล้ว

    this actually works
    wow thx

  • @MarioMario-yb3iz
    @MarioMario-yb3iz 4 ปีที่แล้ว +12

    wait(10)
    print("good video lol")

    • @dylankurtz1121
      @dylankurtz1121 4 ปีที่แล้ว +3

      = true

    • @eoe388
      @eoe388 4 ปีที่แล้ว

      That valid lol

    • @wabiboy
      @wabiboy 2 ปีที่แล้ว

      cannot index nil with 'good video lol' - Some Random Hater

  • @cypressvatau4088
    @cypressvatau4088 2 ปีที่แล้ว +1

    How come it says attempt to index nil with Name’

  • @StrawManROBLOX
    @StrawManROBLOX ปีที่แล้ว

    thanks imma do this but instead of getting to a other pad imma make it a button because im making a tower defense game also imma not use the kill script but instead use a teleprting to game script

  • @zacrylic4040
    @zacrylic4040 4 ปีที่แล้ว

    Suggestion: How to make local music system with mute/unmute song but whenever player dies the music doesn't reset.

  • @lorezomartins4270
    @lorezomartins4270 ปีที่แล้ว

    Thanks and new sub

  • @DeveloperJake
    @DeveloperJake 4 ปีที่แล้ว

    When I do this but go back to the green part it does a glitchy 10 then it goes back to the number that it was previously at because it is still ticking the numbers even though the countdown isn’t visible anymore
    Is there a way to fix this?? Please help

  • @Idle_Idol
    @Idle_Idol 8 หลายเดือนก่อน

    What if I wanted it to add time instead of having it be like a normal timer and when it reaches something like 6AM it awards you a badge then kicks you?

  • @zipgest2.042
    @zipgest2.042 3 ปีที่แล้ว +1

    How do it for mouseclick?

  • @brycerose1001
    @brycerose1001 7 หลายเดือนก่อน

    How would I change this so that the timer appears for everyone on the server when just one player touches the block?

  • @victudhaus
    @victudhaus 4 ปีที่แล้ว

    Can you make a timer where it stops when you touch it like a timer

  • @asianmissmythic02
    @asianmissmythic02 2 ปีที่แล้ว

    would this work in the opposite way of adding more time to the timer instead of counting down instead (speedrun timer)

  • @hungrychicken6784
    @hungrychicken6784 4 ปีที่แล้ว +1

    can u make a vid for a stopwatch instead of a countdown?

    • @TechwithMikeYT
      @TechwithMikeYT  4 ปีที่แล้ว +1

      I'll try and do something like that

  • @xavierprogamer8150
    @xavierprogamer8150 ปีที่แล้ว

    AMAZING but for some reason it says my teleport had a error i did make it public its the exact same as YOUR script soo maybe you could tell me what happend or how to debug it?

  • @hello-dv1hw
    @hello-dv1hw 3 ปีที่แล้ว

    Ayo thanks dude

  • @treybrown3629
    @treybrown3629 4 ปีที่แล้ว

    How would you make it so you could start the timer in a different start and stop?

  • @charpa2891
    @charpa2891 4 ปีที่แล้ว

    How do I make a timer in which it starts at 0, and counts up until the StopBlock is touched? like a time trial

  • @Phantom0507
    @Phantom0507 4 ปีที่แล้ว

    Could you teach us how to script a tool giver but before the person gives the tool to the player they can pick a price and then sell the tool to the player for in game currency (Set by the player giving to the person) like in the game wild west where bartenders can give food to players for money

  • @KewlWIS
    @KewlWIS 4 ปีที่แล้ว

    Hey can you make a timer that goes up instead of down and stops?

  • @willyawanmaulana498
    @willyawanmaulana498 ปีที่แล้ว

    hey mate do you know how to adding chekpoint here? so if im touched the brick says checkpoint i will get 10 seconds added time

  • @cyberghastsecondchannel1057
    @cyberghastsecondchannel1057 4 ปีที่แล้ว

    Can you do it so you can have multiple timers in one server?

  • @fnfmusic7235
    @fnfmusic7235 3 ปีที่แล้ว

    How do you make something like when you need 2 players to start the game you dont move and when theres 2 players the game starts

  • @pacata79
    @pacata79 4 ปีที่แล้ว

    Can you make a stopwatch?It would be really helpful!

  • @prorobloxbacon4755
    @prorobloxbacon4755 4 ปีที่แล้ว

    Thank you!!!

  • @rainbowoof
    @rainbowoof 4 ปีที่แล้ว

    Hey Tetch with Mike! I have a bit weird video idea. But this may help with some roleplay games like mine.
    Could you please make a tool that u can drink? But when u drink it ur screen goes blurry and u have a an effect like your drunk? But the effect lasts for a certain amount of time. Thanks if you read this. By the way i need it for my police rp game so i asked you :)

  • @ItzMeSaber
    @ItzMeSaber 4 ปีที่แล้ว

    How do we make it count up not down?

  • @hmaglione10
    @hmaglione10 3 ปีที่แล้ว

    I'm sorry, Mike, it doesn't work, when I touch the Start part the time doesn't shows up. The output says: Touched is not a valid member of Model "Workspace.Start"

  • @ioac5547
    @ioac5547 4 ปีที่แล้ว

    i love you thanksn

  • @blockmanufacturer714
    @blockmanufacturer714 4 ปีที่แล้ว

    can you make a timer globalboard for the people who finish it

  • @Fe-lq7wn
    @Fe-lq7wn 4 ปีที่แล้ว

    Do u know how to save it to datastote? So i can use it as global leaderboard data

  • @rejubila4239
    @rejubila4239 4 ปีที่แล้ว

    This is like a button, u touched a wall disappears then the time runs out and the wall appiers so u cant pass, but this is better! bc it kills u thxx

  • @zarcastically2147
    @zarcastically2147 4 ปีที่แล้ว

    HEY! How do i make it so instead of it being from 10 to 0 and instead increasing numbers?

  • @PenguinX96
    @PenguinX96 ปีที่แล้ว

    This script is great. But I want it to teleport the character after "if not completed", and I can't figure out any way to make it work. I don't want the death. And I'm working on a game jam. So it's really frustrating. *cries in script*

  • @MaybeTruth
    @MaybeTruth 4 ปีที่แล้ว

    Hello There,
    can you make a leaderboard, so people see what time other people got

  • @verifyjack733
    @verifyjack733 4 ปีที่แล้ว +1

    how do you make it count up??

    • @juicybacon6908
      @juicybacon6908 3 ปีที่แล้ว

      + instead of - but if you want it to kill you you will need to keep it minus

  • @smalldog1349
    @smalldog1349 4 ปีที่แล้ว

    Can you do it with a stopwatch

  • @ryangirisaha
    @ryangirisaha 3 ปีที่แล้ว

    hey tech with mike, i want a timer which starts from 0 and ends when you touch the oehter part

    • @philipryanbasas973
      @philipryanbasas973 3 ปีที่แล้ว

      Here I made my own...
      get it
      www.roblox.com/library/7174872693/TimerIncreasing

  • @mathmeal188
    @mathmeal188 3 ปีที่แล้ว

    rip to me bc i typed the whole thing without knowing there was a link to the code

  • @the_actual_alex
    @the_actual_alex 4 ปีที่แล้ว

    this tutorial in a nutshell:
    and we're gonna make one called local
    and then we're gonna make another one called local
    and then we're gonna make another one called local
    and then we're gonna make another one called local
    and then we're gonna make another one called local

    • @TechwithMikeYT
      @TechwithMikeYT  4 ปีที่แล้ว

      What's your point? If variables are needed for a script, I'm not sure how I am supposed to avoid that.

    • @the_actual_alex
      @the_actual_alex 4 ปีที่แล้ว

      @@TechwithMikeYT no i just think its funny how much the script has local

  • @Davi-kc2wq
    @Davi-kc2wq 4 ปีที่แล้ว

    Mike, instead of using var = var - num or var = var + num use var += num or var -= num.

  • @Amir-fm9jm
    @Amir-fm9jm 3 ปีที่แล้ว

    its not working for me when i go on the block it doesn't show up

  • @demonwasused
    @demonwasused 4 ปีที่แล้ว

    Is there a way to make a timer so that when you start the game it automatically runs and when the time runs out the timer restarts? If there is can you reply to this message with the script or make a video about it? Thx!

    • @heypikachu276
      @heypikachu276 3 ปีที่แล้ว

      It's a simple while true do loop.
      All you need is a "while true do" for a loop. Then you get that to repeat, and it's done.
      Also no you do not need a "PlayerAdded"

  • @idk_ez
    @idk_ez 4 ปีที่แล้ว

    How do you make a counter that tracts time when you step on a block then stops when you go on another block. kinda like that same thing just going up instead of couting down?

    • @thewangaccount2644
      @thewangaccount2644 4 ปีที่แล้ว

      that's exactly what l need to. the completely reverse.

  • @ninjaprohacker-to5wr
    @ninjaprohacker-to5wr 4 ปีที่แล้ว

    I dont know how u add start and stop and what to add so the work

  • @drawinns669
    @drawinns669 4 ปีที่แล้ว

    how would i make multiple timers

  • @jayyyyyyy5531
    @jayyyyyyy5531 4 ปีที่แล้ว

    is there a way u can have multiple timers example on one i want 30 seconds on the other i want 5 seconds please help!!!!!!! @Tech with Mike

  • @JayPPlayz
    @JayPPlayz 3 ปีที่แล้ว

    Yes. Yes.
    I can make a Piggy game. 600 seconds? Nah, 900 for me.

  • @franzisjaycorpuz9989
    @franzisjaycorpuz9989 4 ปีที่แล้ว

    wait what is the green and red called

  • @MoO-ix1kw
    @MoO-ix1kw 4 ปีที่แล้ว +1

    me took 36 min to fallow a 11 min tutorial
    then i found out the code is aleady copyed in dec 😶

    • @TechwithMikeYT
      @TechwithMikeYT  4 ปีที่แล้ว +1

      Lol well now you know for future videos!

  • @_fregnub
    @_fregnub 3 ปีที่แล้ว

    can you make a version where it automaticly starts as soon as you join the game?

    • @NotZDH
      @NotZDH 3 ปีที่แล้ว +1

      You can rename the spawn to Start

    • @_fregnub
      @_fregnub 3 ปีที่แล้ว

      @@NotZDH Ok Thanks

  • @mikeahlinder2475
    @mikeahlinder2475 2 ปีที่แล้ว

    Hey mike. I hope you see this.. i have a problem and i figure that since we have the same name maybe you could help me out? i have been trying to get my RoundTimer function to show on a Part surface gui insted of a gui on the screen. but i cant seem to wrap my head around it.. is there any way you could help me out?

    • @mikeahlinder2475
      @mikeahlinder2475 2 ปีที่แล้ว

      local replicatedStorage = game:GetService("ReplicatedStorage")
      local values = replicatedStorage:WaitForChild("Values")
      local status = values:WaitForChild("status")
      local text = script.Parent
      status.Changed:Connect(function()
      text.Text = status.Value
      end)
      this is a Localscript in the TextLabel in a surfaceGui attached to a part, but it wont change the text

    • @mikeahlinder2475
      @mikeahlinder2475 2 ปีที่แล้ว

      oi again.. i solved the problem by inserting a script insted of Localscript into the surfaceGui as parent and changed the local text = script.parent to this..- local text = script.Parent.Time. so thanks anyway! :D

  • @walmartventi5696
    @walmartventi5696 4 ปีที่แล้ว

    Can you make a script for chest or presents spawning in 5 mins. I wanna do something like royale high but different

  • @ceznaa3228
    @ceznaa3228 3 ปีที่แล้ว

    The code in your desc is different i think.

  • @ashneelprakash7346
    @ashneelprakash7346 3 ปีที่แล้ว

    Do you know how to have the timer increase instead of decreasing? Like when you step on platform and then a timer appears except the time goes up every second

    • @philipryanbasas973
      @philipryanbasas973 3 ปีที่แล้ว

      here i made one
      www.roblox.com/library/7174872693/TimerIncreasing

  • @beto1424
    @beto1424 3 ปีที่แล้ว

    I need 3 decimal timer

  • @seancruz7338
    @seancruz7338 3 ปีที่แล้ว

    How to make a timer gui that if the time runs out, the player respawns to the spawn?

    • @philipryanbasas973
      @philipryanbasas973 3 ปีที่แล้ว

      just get all the children from Players using for loop then movethem to whereever you want
      u

  • @olbancalamari1750
    @olbancalamari1750 4 ปีที่แล้ว

    epic how you sound like dream

  • @dioplate2253
    @dioplate2253 3 ปีที่แล้ว

    make a timer GUI that activates when a key is pressed

  • @timeanchorgamer527
    @timeanchorgamer527 3 ปีที่แล้ว

    PLEASE HELP NOW! ALL THAT HAPPENS IS AS SOON AS YOU SPAWN YOU CAN SEE THE LABEL! and when you go on the block it does nothing

    • @TechwithMikeYT
      @TechwithMikeYT  3 ปีที่แล้ว

      Check the output while testing for error messages

    • @TheBiggestOfTheBig
      @TheBiggestOfTheBig 3 ปีที่แล้ว

      @@TechwithMikeYT what is the output? im new to studio

    • @timeanchorgamer527
      @timeanchorgamer527 3 ปีที่แล้ว

      @@TechwithMikeYT I had a solution. I couldn’t figure it out so I made a button with a click detector that served the same purpose as having to get to another point before the timer ran our

    • @iamchicken3439
      @iamchicken3439 3 ปีที่แล้ว

      @@TechwithMikeYT yo so im trying to implement this with a chest for a timer so like i open the chest and u will have to wait another 1hour to open it again and it shows a little guibillboard on the part and its a proximitypromp and not a touch

  • @AceForgotten
    @AceForgotten 4 ปีที่แล้ว

    didnt Start my Time if i Step the Pad but my Script is correct

  • @Rob-fu7cl
    @Rob-fu7cl 3 ปีที่แล้ว

    how do you make it into minutes?

  • @zacharyabunda5344
    @zacharyabunda5344 4 ปีที่แล้ว

    idk how to put the timer in the explore