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

How to make a game repeatedly check for something?

Asked by
Yeevivor4 155
9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
function checkPartsLeft()
    local count = 0 
    local PartsLeft = game.Workspace:findFirstChild(PartsLeft.Value)
    if PartsLeft ~= nil then
        part = part + 1
    end
end
    if count == 3 or count == 3 then
        time.Value = 0 
        for i = 1, #players do 
            if players[i].TeamColor == game.Teams.Runners.TeamColor then
                MainText2.Value = true
                Workspace.MainText.Value = "All parts have been found"
                wait(2)
                MainText2.Value = false
            end
            end
            end
                print ("Checking PartsLeft")

Hi, if anyone can help me, I was wondering whether this scripting is correct. What I'm trying to do is make a function that repeatedly checks if a NumberValue's value is 3 and if the value is 3, then the time will go down to 0.

0
Any errors in the output that we should know about? OniiCh_n 410 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago

Make the part that you want it to do in a while true do.

 while true do
if count == 3 or count == 3 then
        time.Value = 0 
        for i = 1, #players do 
            if players[i].TeamColor == game.Teams.Runners.TeamColor then
                MainText2.Value = true
                Workspace.MainText.Value = "All parts have been found"
                wait(2)
                MainText2.Value = false
            end
            end
            end
end
Ad

Answer this question