Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a game repeatedly check for something?

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.

1 comment

0

Any errors in the output that we should know about?

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.