Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

My final question "?"

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Okay, I have a timer. I am creating game called "Crocodile". In this game one of players becomes "Artist". Guy who drawing words. And all players must guess this word by drawing.

01while GameStart == true do
02    TimerMessage = Instance.new("Hint", game.Workspace)
03    TimerMessage.Text = "This game will end in " ..TimerValue.. " seconds"
04    wait(1)
05    TimerValue = TimerValue - 1
06    TimerMessage:remove()
07    if TimerValue == 0 then
08        GameStart = false
09        IsArtist = false
10        TimerValue = 120
11    end
12end

and when value GameStart = false script running this:

01while GameStart == false do
02    local MaybeArtist = game.Players:GetChildren()
03    game.Workspace.Paintining.ColorPart.BrickColor = BrickColor.White()
04    game.ServerStorage.Value.Value = BrickColor.White()
05    if #MaybeArtist >= 2 then
06        CoolHint = Instance.new("Hint", game.Workspace)
07        CoolHint.Text = "Choosing player..."
08        local RealArtist = MaybeArtist[math.random(#MaybeArtist)]
09        RealArtist.TeamColor = BrickColor.Red()
10        CoolHint.Text = "Choosed!"
11        RealArtist.Character.Humanoid.Health = 0
12        GameStart = true
13        IsArtist = true
14        CoolHint:remove()
15            if IsArtist == false then
View all 27 lines...

Its works yeah, but one problem. When GameStart becomes true, timer doesnt work. But if i am turned "true" in script, its works. But when script running "true" its doesnt work. Why? Sorry for my bad grammar, its bad. I am not from english countries, i am learning english.

0
no answers :( VladFox 5 — 9y
0
I am confused, what are you trying to make it do, and what is going on exactly? NinjoOnline 1146 — 9y
0
i am updated post. VladFox 5 — 9y

1 answer

Log in to vote
3
Answered by 9 years ago
01while wait() do
02    while GameStart == true do
03        TimerMessage = Instance.new("Hint", game.Workspace)
04        TimerMessage.Text = "This game will end in " ..TimerValue.. " seconds"
05        wait(1)
06        TimerValue = TimerValue - 1
07        TimerMessage:remove()
08        if TimerValue == 0 then
09            GameStart = false
10            IsArtist = false
11            TimerValue = 120
12        end
13    end
14 
15    while GameStart == false do
View all 42 lines...

I believe this should fix your problem. What I did was add a While loop so it continuously goes through the loops, and so when one thing is changed it goes to the other, and so on.

Hope this helped and be sure to +1 and accept answer.

If not, please reply back or EDIT your question with the script and any errors in the output so I can fix it as soon as possible.

  • NinjoOnline
0
oh man, YOU REALLLY HELPED ME. HUGE THANKS YOU.. And sorry, i cant upvote coz i dont have 5 upvotes :^( VladFox 5 — 9y
0
You should be able to accept the answers though... NinjoOnline 1146 — 9y
Ad

Answer this question