of     1   

gum444
#184100341Sunday, February 21, 2016 9:42 PM GMT

Why does the time stop at 2 if it says until time = 0? Is this a glitch? function StartRound() local m = Instance.new("Hint") m.Parent = game.Workspace local Time = "10" repeat wait(1) m.Text = "The game will begin in "..Time.." seconds!" Time = Time - 1 until Time == 0 --This is what I'm talking about! m.Text = "The round will now begin!" end StartRound()
ha_h
#184100443Sunday, February 21, 2016 9:43 PM GMT

add while true do . yes my siggy
gum444
#184100858Sunday, February 21, 2016 9:50 PM GMT

Does not work, does same thing ROBLOX is broken
ha_h
#184100939Sunday, February 21, 2016 9:51 PM GMT

oh wait set time to 4*x and y of the new instance block of z yes my siggy
HumanXerxes
#184101071Sunday, February 21, 2016 9:53 PM GMT

function StartRound() local m = Instance.new("Hint") m.Parent = game.Workspace for Time=10,0,-1 do m.Text = "The game will begin in "..Time.." seconds!" wait(1) end m.Text = "The round will now begin!" end StartRound()
gum444
#184101274Sunday, February 21, 2016 9:56 PM GMT

No I don't want a script, Im just saying that this thing is broken and should not stop at 2!
HumanXerxes
#184101763Sunday, February 21, 2016 10:03 PM GMT

function StartRound() local m = Instance.new("Hint") m.Parent = game.Workspace local Time = "10" repeat wait(1) m.Text = "The game will begin in "..Time.." seconds!" Time = Time - 1 until Time == -1 --This is what I'm talking about! m.Text = "The round will now begin!" end StartRound()
HumanXerxes
#184101821Sunday, February 21, 2016 10:04 PM GMT

It might just be how repeat works, I barely use it though.
gum444
#184102007Sunday, February 21, 2016 10:07 PM GMT

I did use the -1 value instead of 0. But roblox needs to fix that :/
filiptibell
#184102278Sunday, February 21, 2016 10:11 PM GMT

The problem is with the "Time" variable. Time in your script is a string. You can't do math (like Time = Time - 1) on a string. Strings are used for text. Replace: local Time = "10" with local Time = 10
HumanXerxes
#184102588Sunday, February 21, 2016 10:15 PM GMT

@filiptibell, Actually, I was going to say the same thing at first but I tested: print("10"-1) >9 So Lua must use the tonumber() function on strings if you try doing math on them.
HumanXerxes
#184102640Sunday, February 21, 2016 10:16 PM GMT

You're still right though, it shouldn't be set as a string.
filiptibell
#184102942Sunday, February 21, 2016 10:21 PM GMT

Woops. I had no idea, that's kinda unexpected. The problem was that you had the wait(1) before doing Time = Time - 1. Move it to the end of the repeat statement instead, and it works just fine: function StartRound() local m = Instance.new("Hint") m.Parent = game.Workspace local Time = 10 repeat m.Text = "The game will begin in "..Time.." seconds!" Time = Time - 1 wait(1) until Time == 0 m.Text = "The round will now begin!" end StartRound()
Daftcube
#184103909Sunday, February 21, 2016 10:35 PM GMT

Using repeat isn't generally considered a good practice, as some other types of loops do its job better. That's what I hear, at least.

    of     1