How to Make a Timer GUI - Roblox Studio Tutorial

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 199

  • @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!

  • @r41nar
    @r41nar 3 года назад +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

  • @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 2 года назад +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 2 года назад

      well as of 1/4/22 it DOESNT work

    • @NotZDH
      @NotZDH 2 года назад

      @@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 10 месяцев назад +1

      as of 11/15/2023 it still works xD

  • @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

  • @tylerhuff7394
    @tylerhuff7394 Год назад +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

  • @RJGamesMoviesandMore
    @RJGamesMoviesandMore 4 года назад +2

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

  • @legal304
    @legal304 3 года назад +1

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

  • @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. :)

  • @abomination1456
    @abomination1456 3 года назад

    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!

  • @shotokanjuul2191
    @shotokanjuul2191 3 года назад +3

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

  • @wumtus4734
    @wumtus4734 4 года назад +2

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

  • @mizies
    @mizies 3 года назад +3

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

    • @rejubila4239
      @rejubila4239 3 года назад

      Thats what im looking for for like 1 month

  • @esaedits8754
    @esaedits8754 3 года назад +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)

  • @user-ed5cf8ku7e
    @user-ed5cf8ku7e 4 года назад +4

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

  • @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! :)

  • @Fishy883
    @Fishy883 3 года назад +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.

  • @mrblueanimationmanz2261
    @mrblueanimationmanz2261 3 года назад

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

  • @buildersclub3773
    @buildersclub3773 3 года назад +1

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

  • @MarioMario-yb3iz
    @MarioMario-yb3iz 4 года назад +12

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

    • @dylankurtz1121
      @dylankurtz1121 4 года назад +3

      = true

    • @eoe388
      @eoe388 3 года назад

      That valid lol

    • @wabiboy
      @wabiboy 2 года назад

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

  • @branchfromwish
    @branchfromwish 10 месяцев назад

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

  • @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 3 года назад

    This is literally exactly what I wanted! Thank you!

  • @west8772
    @west8772 4 года назад +1

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

  • @Idle_Idol
    @Idle_Idol 4 месяца назад

    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?

  • @brycerose1001
    @brycerose1001 3 месяца назад

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

  • @DeveloperJake
    @DeveloperJake 3 года назад

    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

  • @inventors631
    @inventors631 4 года назад +1

    dude this helped so much thx

  • @cjlegoman3502
    @cjlegoman3502 3 года назад

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

  • @SEANPLAYZYT
    @SEANPLAYZYT 4 года назад +1

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

  • @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))

  • @realmuslim6097
    @realmuslim6097 3 года назад

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

  • @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.

  • @cypressvatau4088
    @cypressvatau4088 2 года назад +1

    How come it says attempt to index nil with Name’

  • @patrik2295
    @patrik2295 2 года назад

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

  • @Fusioneditz69
    @Fusioneditz69 3 года назад

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

  • @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

  • @wendysbrenes9833
    @wendysbrenes9833 3 года назад +1

    thanks for helping me and good video

  • @Amir-fm9jm
    @Amir-fm9jm 3 года назад

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

  • @hmaglione10
    @hmaglione10 2 года назад

    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"

  • @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

  • @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

  • @charpa2891
    @charpa2891 3 года назад

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

  • @Keketin
    @Keketin 2 года назад

    Keep up the good work. :D

  • @ThePenquinX
    @ThePenquinX 8 месяцев назад

    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*

  • @zipgest2.042
    @zipgest2.042 2 года назад +1

    How do it for mouseclick?

  • @asianmissmythic02
    @asianmissmythic02 2 года назад

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

  • @treybrown3629
    @treybrown3629 3 года назад

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

  • @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

  • @dusanmann
    @dusanmann 2 года назад

    Thank you for the timer

  • @maximusboyer8098
    @maximusboyer8098 3 года назад

    doesnt work i clicked this to make it for my new game called assassin Mystery and i needed a timer for a intermission

  • @satriakanesantoso
    @satriakanesantoso 3 года назад

    Thanks buddy apprecioate it!

  • @jayyyyyyy5531
    @jayyyyyyy5531 3 года назад

    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

  • @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?

  • @erold2015
    @erold2015 3 года назад

    this actually works
    wow thx

  • @zarcastically2147
    @zarcastically2147 4 года назад

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

  • @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 3 года назад

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

  • @lorezomartins4270
    @lorezomartins4270 Год назад

    Thanks and new sub

  • @hello-dv1hw
    @hello-dv1hw 3 года назад

    Ayo thanks dude

  • @RositaaaAAaa
    @RositaaaAAaa 3 года назад

    How do u get the red and green button

  • @ninjaprohacker-to5wr
    @ninjaprohacker-to5wr 4 года назад

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

  • @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!

  • @mikeahlinder2475
    @mikeahlinder2475 Год назад

    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 Год назад

      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 Год назад

      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

  • @robloxrunningproject4912
    @robloxrunningproject4912 3 года назад

    November 7 2020. The script did not work.

  • @victudhaus
    @victudhaus 3 года назад

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

  • @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

  • @demonwasused
    @demonwasused 3 года назад

    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"

  • @verifyjack733
    @verifyjack733 3 года назад +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

  • @franzisjaycorpuz9989
    @franzisjaycorpuz9989 3 года назад

    wait what is the green and red called

  • @ioac5547
    @ioac5547 3 года назад

    i love you thanksn

  • @drawinns669
    @drawinns669 3 года назад

    how would i make multiple timers

  • @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

  • @zacrylic4040
    @zacrylic4040 4 года назад

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

  • @timeanchorgamer527
    @timeanchorgamer527 2 года назад

    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  2 года назад

      Check the output while testing for error messages

    • @TheBiggestOfTheBig
      @TheBiggestOfTheBig 2 года назад

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

    • @timeanchorgamer527
      @timeanchorgamer527 2 года назад

      @@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 2 года назад

      @@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

  • @ritwiksharma2488
    @ritwiksharma2488 3 года назад

    Can you tell me that why did my timer not started, I copied the script which is in discription please tell

    • @TechwithMikeYT
      @TechwithMikeYT  3 года назад

      Can you check the output while the game is running to see if you have any error messages?

    • @ritwiksharma2488
      @ritwiksharma2488 3 года назад

      @@TechwithMikeYT thanks, my work is done from toolbox.

  • @mathmeal188
    @mathmeal188 3 года назад

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

  • @zacharyabunda5344
    @zacharyabunda5344 3 года назад

    idk how to put the timer in the explore

  • @k_wl
    @k_wl 3 года назад

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

  • @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

  • @prorobloxbacon4755
    @prorobloxbacon4755 3 года назад

    Thank you!!!

  • @Fe-lq7wn
    @Fe-lq7wn 4 года назад

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

  • @AceForgotten
    @AceForgotten 3 года назад

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

  • @cyberghastsecondchannel1057
    @cyberghastsecondchannel1057 4 года назад

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

  • @Blyatmeister-yr6he
    @Blyatmeister-yr6he 3 года назад

    Isn’t this a countdown kinda video not a timer?

  • @walmartventi5696
    @walmartventi5696 3 года назад

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

  • @Rob-fu7cl
    @Rob-fu7cl 3 года назад

    how do you make it into minutes?

  • @smalldog1349
    @smalldog1349 3 года назад

    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

  • @rejubila4239
    @rejubila4239 3 года назад

    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

  • @hungrychicken6784
    @hungrychicken6784 4 года назад +1

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

  • @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 :)

  • @ajwoodjr4924
    @ajwoodjr4924 3 года назад

    is the screengui sussposed to be "Timer" Or "timer"

  • @SyedIbrahim-ut4cz
    @SyedIbrahim-ut4cz 3 года назад

    Why does my coding domt work if I do what exactly he did?

    • @TechwithMikeYT
      @TechwithMikeYT  3 года назад

      Can you check output while the game is running to see if there are error messages?

    • @SyedIbrahim-ut4cz
      @SyedIbrahim-ut4cz 3 года назад

      When I am writing the script and seeing from the script recovery there are no errors but when I am running the game a last , nothing is happening

  • @pacata79
    @pacata79 3 года назад

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

  • @blockmanufacturer714
    @blockmanufacturer714 3 года назад

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

  • @_fregnub
    @_fregnub 2 года назад

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

    • @NotZDH
      @NotZDH 2 года назад +1

      You can rename the spawn to Start

    • @_fregnub
      @_fregnub 2 года назад

      @@NotZDH Ok Thanks

  • @MaybeTruth
    @MaybeTruth 3 года назад

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

  • @jadenn8
    @jadenn8 4 года назад

    How do I change the time? @Toasted Cardboard - @Tech With Mike

    • @TechwithMikeYT
      @TechwithMikeYT  4 года назад

      Change this line
      local time_val = 10

    • @jadenn8
      @jadenn8 4 года назад

      Thank you mike! I will always use your vids! I subbed and liked every of your vids!