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

A conditional while the time passes?

I mean, i want that,while the time "120" is passing ,check if *Mision.value * is == 1,im using that script,Other conditional need to be used?

while true do
if workspace.Mision.Value == 1 then 
	
	
local c2 = Instance.new ("Message")
c2.Parent = game.Workspace
c2.Text = "All clear"

else
	
	wait (120)
end

end

2 comments

0

what r u saying

0

Messages are deprecated

1 answer

Here try this:

local count = 0

while true do
	wait(1)
	count = count + 1
	if workspace.Mision.Value == 1 then
		local c2 = Instance.new ("Message")
		c2.Text = "Gas Station Call"
		c2.Parent = game.Workspace
		c2.Text = "All clear"
	elseif count >= 120 then -- 
		break -- completely stops the script
	end
end

if that doesn't work then:

local count = 0

while count < 120 do
	wait(1)
	count = count + 1
	if workspace.Mision.Value == 1 then
		local c2 = Instance.new ("Message")
		c2.Text = "Gas Station Call"
		c2.Parent = game.Workspace
		c2.Text = "All clear"
	ebd
end

Hopefully this helped!

Best of luck developer!

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