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.

while GameStart == true do
    TimerMessage = Instance.new("Hint", game.Workspace)
    TimerMessage.Text = "This game will end in " ..TimerValue.. " seconds"
    wait(1)
    TimerValue = TimerValue - 1
    TimerMessage:remove()
    if TimerValue == 0 then
        GameStart = false
        IsArtist = false
        TimerValue = 120
    end
end

and when value GameStart = false script running this:

while GameStart == false do
    local MaybeArtist = game.Players:GetChildren()
    game.Workspace.Paintining.ColorPart.BrickColor = BrickColor.White()
    game.ServerStorage.Value.Value = BrickColor.White()
    if #MaybeArtist >= 2 then
        CoolHint = Instance.new("Hint", game.Workspace)
        CoolHint.Text = "Choosing player..."
        local RealArtist = MaybeArtist[math.random(#MaybeArtist)]
        RealArtist.TeamColor = BrickColor.Red()
        CoolHint.Text = "Choosed!"
        RealArtist.Character.Humanoid.Health = 0
        GameStart = true
        IsArtist = true
        CoolHint:remove()
            if IsArtist == false then
    RealArtist.TeamColor = BrickColor.Blue()
    RealArtist.Character.Humanoid.Health = 0
end 
    end    
    if #MaybeArtist == 1 then
        SorryHint = Instance.new("Hint", game.Workspace)
        SorryHint.Text = "Not enough players! Sorry!"
        wait(1)
        SorryHint:remove()
    end
    wait(5)
end

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
while wait() do
    while GameStart == true do
        TimerMessage = Instance.new("Hint", game.Workspace)
        TimerMessage.Text = "This game will end in " ..TimerValue.. " seconds"
        wait(1)
        TimerValue = TimerValue - 1
        TimerMessage:remove()
        if TimerValue == 0 then
            GameStart = false
            IsArtist = false
            TimerValue = 120
        end
    end

    while GameStart == false do
        local MaybeArtist = game.Players:GetChildren()
        game.Workspace.Paintining.ColorPart.BrickColor = BrickColor.White()
        game.ServerStorage.Value.Value = BrickColor.White()
        if #MaybeArtist >= 2 then
            CoolHint = Instance.new("Hint", game.Workspace)
            CoolHint.Text = "Choosing player..."
            local RealArtist = MaybeArtist[math.random(#MaybeArtist)]
            RealArtist.TeamColor = BrickColor.Red()
            CoolHint.Text = "Choosed!"
            RealArtist.Character.Humanoid.Health = 0
            GameStart = true
            IsArtist = true
            CoolHint:remove()
                if IsArtist == false then
        RealArtist.TeamColor = BrickColor.Blue()
        RealArtist.Character.Humanoid.Health = 0
    end 
        end    
        if #MaybeArtist == 1 then
            SorryHint = Instance.new("Hint", game.Workspace)
            SorryHint.Text = "Not enough players! Sorry!"
            wait(1)
            SorryHint:remove()
        end
        wait(5)
    end
end

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