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

Why isn't this script working, It's to do with changing the value?

This script is for when the value hits 11 the text = 20 I have the same script but the value = 10 then works, the orig value of hello = 10 but when I change the value to 11 the script dosen't work

if game.Workspace.Hello.Value == 11 then
	while true do
		wait(1)
		script.Parent.Text = "20"
end
end

1 comment

0

Maybe you should've placed the "if" statement in the loop?

2 answers

if game.Workspace.Hello.Value == 11 then
    while true do
        wait(1)
        script.Parent.Text = "20"
elseif game.workspace.hellp.Value >= 11 then
	--put your code here	
	end
end)

Hope this helped

1 comment

0

I don't need the elseif

not sure what you mean, do you want it to be exactly at 11 or it changes even if the value is past 11? If the value changes and does not stay the same, you will have to include the if in the loop as well.

while wait() do
      if game.Workspace.Hello.Value == 11 then
         script.Parent.Text = "20"
end
end

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