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

looking for a way to see if a value has not changed?

what i want to do is see if the value changed after 2 seconds

wait(2)
if not Value.Changed then
	print("value did not change")
end

i know this does not work as .Changed is supposed to be for functions, but thats a clear way to show you what i mean.

thanks for your help!

3 answers

local test = true

while wait(2) do
	if test == true then
		print("Value has not changed")
	end
end

Is this what you mean?

1 comment

0

not really

This should work.

local checking = true
local valueToCheck = path
local ogValue = valueToCheck.Value

while true do wait(1)
	if checking == true then
		if valueToCheck.Value ~= ogValue then
			print('value is different')
			break
		else
		end
	end
end

I found clean way to do that

local prevTime = 0
local currTime = 0

prevTime = currTime
currTime = tick()
local passedTime = currTime - prevTime
if passedTime >= 2 then
	Value.Value = 1
end

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