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

How would I go about making something run again when a value changes?

How would I make this continue running so that after waiting.value is false and i turn it back to true how do i make that work

local Waiting = script.Parent.Parent.Parent.Wait
local Te = script.Parent
local Temp = game.ServerStorage.Temp


	if Waiting.Value == true then
		while Waiting.Value == true do
			Te.Text = "The Temperature is"
			wait(.5)
			Te.Text = "The Temperature is."
			wait(.5)
			Te.Text = "The Temperature is.."
			wait(.5)
			Te.Text = "The Temperature is..."
			wait(.5)
		end
	end

	if Waiting.Value == false then
		Te.Text = 'The Temperature is \n'..Temp.Value
	end

1 comment

0

You never make the value to false, so no wonder, your code will never reach the false.

1 answer

Nevermind just put it in a while true loop

local Waiting = script.Parent.Parent.Parent.Wait
local Te = script.Parent
local Temp = game.ServerStorage.Temp




while true do
	if Waiting.Value == true then
		while Waiting.Value == true do
			Te.Text = "The Temperature is"
			wait(.5)
			Te.Text = "The Temperature is."
			wait(.5)
			Te.Text = "The Temperature is.."
			wait(.5)
			Te.Text = "The Temperature is..."
			wait(.5)
		end
	end

	if Waiting.Value == false then
		Te.Text = 'The Temperature is \n'..Temp.Value
	end
end

1 comment

0

You clearly did not get it, 'how to change it back to true' as they said.

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