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

Value not changing when another value reaches a number?

I am trying to make value1 +1 when value0 reaches 100, though it doesn't work.

val0 = script.Parent.val0
val1 = script.Parent.val1

while true do wait()
	if val0.Value == 100 then
		val1.Value =  val1.Value +1
	else
		
	end
end

Any help would be greatly appreciated. Thanks!

1 comment

0

woops my answer was wrong

1 answer

Hmm, I'm not quite sure why that didn't work for you, but try this:

val0 = script.Parent:WaitForChild("Val0");
val1 = script.Parent:WaitForChild("Val1");

while wait() do
	if val0.Value >= 100 then
		val1.Value = val1.Value + 1;	
	else
		print("Val0 is less than 100 ("..tostring(val0.Value)..")");
	end
end

3 comments

0

Why would that help? Explain your answer and I'll remove the dislike.

0

I'll remove the dislike anyways I don't want to be too harsh.

0

It may not work, I'm not entirely sure. I never said it would 100% work, I was simply making a suggestion that could POSSIBLY fix his error. No worries, though. I understand where you're coming from.

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